示例#1
0
文件: Games19.java 项目: ktw14/vitoex
 public void play() {
   print("Toss Coin: ");
   switch (rand.nextInt(2)) {
     case 0:
       println("Heads");
       return;
     case 1:
       println("Tails");
       return;
     default:
       println("OnEdge");
       return;
   }
 }
示例#2
0
文件: Games19.java 项目: ktw14/vitoex
 public void play() {
   print("Throw Dice: " + (rand.nextInt(6) + 1));
 }