Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Random;
- public class CubeScouts {
- public static void main(String[] args)
- {
- final int CUBE_SIZE = 6;
- Random r = new Random();
- int[] cube = new int[CUBE_SIZE];
- int current = 1;
- while(cube[current - 1] <= 2)
- {
- current = 1 + (r.nextInt(6));
- cube[current - 1]++;
- }
- System.out.printf("The winning number is %d.", current);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement