Advertisement
Guest User

DiceGame

a guest
Jan 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. public class DiceGame{
  2. public static void main(String[] args) {
  3. int a = (int) (3*Math.random()+1);
  4. int b = (int) (3*Math.random()+1);
  5. boolean win = a == 3 && b == 3;
  6. if (a == 3 && b == 3) {
  7. System.out.println("You win!");
  8. } else {
  9. System.out.println("You lose...");
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement