⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 playgame.java

📁 Java经典例程 从外国一大学计算机教授出版物下载的代码 经典
💻 JAVA
字号:
import java.io.*;
import javagently.*;

class PlayGame {

  /* The Playing Game program      by J M Bishop   Aug 1996
   * ------------------------      Java 1.1
   *                               updated June 2000
   * Driver for playing Rocks-Scissors-Paper.
   * Calls methods in the RSP class to get
   * my choice and the computer's choice and
   * display who has won until Q is typed.
   * Illustrates conditional loops and objects
   */

  public static void main (String [] args) throws IOException {
    new PlayGame ();
  }

  PlayGame () throws IOException {

    RSPGame mygame = new RSPGame ();
    mygame.startGame ();

    while (true) {
      mygame.makemyChoice();
      if (mygame.getyourChoice ()=='Q') break;
      mygame.winner();
    }
    System.out.println("Thanks for playing");
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -