Ejemplo n.º 1
0
 public void play() {
   print("Toss Coin: ");
   switch (rand.nextInt(2)) {
     case 0:
       println("Heads");
       return;
     case 1:
       println("Tails");
       return;
     default:
       println("OnEdge");
       return;
   }
 }
Ejemplo n.º 2
0
 public void play() {
   print("Throw Dice: " + (rand.nextInt(6) + 1));
 }