📄 playgame.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 + -