This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
//Player recognizable; Wrong number protection | |
public class Practive{ | |
public static void main(String[] args){ | |
int remain = 21; | |
Scanner scan = new Scanner(System.in); | |
System.out.println("The rules of this game are simple. You start with 21 sticks, then two players take turns alternatively"); | |
System.out.println("either taking one or two sticks. The player who takes the last stick loses."); | |
System.out.println(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Practive{ | |
public static void main(String[] args){ | |
int remain = 21; | |
Scanner scan = new Scanner(System.in); | |
while (remain >1){ | |
System.out.println("Take 1 or 2 sticks"); | |
int input = scan.nextInt(); | |
remain = remain -input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
import java.util.Scanner; | |
public class Practive{ | |
public static void main (String[] args){ | |
Random rand = new Random(); | |
int numberToGuess = rand.nextInt(1000); | |
int numberOfTries = 0; | |
Scanner input = new Scanner (System.in); | |
int guess; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span style="color:#808080;"><h4><a href="http://scarlettyusj.blogspot.com/2015/01/music-benvenutowelcome-by-premio-sciacca.html">Benvenuto (Premiosciacca) </a></h4> </span> | |
<p> | |
<audio controls> | |
<source src="https://sites.google.com/site/indecisivefin/home/Track2.mp3?revision=1" type="audio/ogg"> | |
<source src="https://sites.google.com/site/indecisivefin/home/Track2.mp3?revision=1" type="audio/mpeg"> | |
</source></source></audio></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class Practive{ | |
public static void main (String[] args) | |
{ | |
int [] array = new int[] {23,45,34,54,67,78}; | |
System.out.println("Original array:"); | |
System.out.println(Arrays.toString(array)); | |
//reverse method 1: | |
int i =0; | |
while ( i< (array.length)/2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Practive{ | |
public static void main (String[] args){ | |
strmanip(); | |
} | |
static void strmanip(){ | |
String name =""; | |
String password=""; | |
try{ | |
BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//©UCLA-SPS 2016 | |
START | |
{ | |
Boolean rand1; | |
Boolean rand2; | |
Boolean rand3; | |
Boolean rand4; | |
Boolean rand5; | |
Boolean ip1==false; | |
Boolean ip2==false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START | |
{ | |
Boolean rand1; | |
Boolean rand2; | |
Boolean rand3; | |
Boolean rand4; | |
Boolean rand5; | |
Boolean ip1==false; | |
Boolean ip2==false; | |
Boolean ip3==false; |