用java编写猜数游戏

时间:2014-01-11 12:04:02
【文件属性】:
文件名称:用java编写猜数游戏
文件大小:3KB
文件格式:RAR
更新时间:2014-01-11 12:04:02
猜数游戏 import java.util.Scanner; public class Test{ public static void main(String args[]){ int i; Game game=new Game(); Scanner in=new Scanner(System.in); while(true){ System.out.println("\t\t\t欢迎光临猜数游戏"); System.out.println("\t1—开始游戏\t0-退出游戏"); i=in.nextInt(); if(i==0) { System.out.println("游戏结束!");System.exit(0);break; } else if(i==1) game.start(); else System.out.println("对不起,请您重新输入(0或1)!"); } } }
【文件预览】:
guessDataGame
----.project(389B)
----bin()
--------Game.class(1KB)
--------Test.class(1012B)
----src()
--------Game.java(664B)
--------Test.java(500B)
----.classpath(232B)

网友评论