Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Dice simulator
- int ranNum = (int)(Math.random() * 6);
- switch(ranNum) {
- case 0: System.out.println("You rolled one"); break;
- case 1: System.out.println("You rolled two"); break;
- case 2: System.out.println("You rolled three"); break;
- ...
- case 6: System.out.println("You rolled six"); break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement