[java]代码库
第一个Java文件: import java.util.Scanner; public class GameA_B { public static void main(String[] args) { Scanner reader=new Scanner(System.in); int area; System.out.println("Game Start…………Please enter the area:(1-9)" + '\n'+"1,2,3 means easy"+'\n'+"4,5,6 means middle"+'\n'+ "7,8,9 means hard"+'\n'+"Please choose:"); area=reader.nextInt(); switch((area-1)/3) { case 0:System.out.println("You choose easy! ");break; case 1:System.out.println("You choose middle! ");break; case 2:System.out.println("You choose hard! ");break; } System.out.println("Good Luck!"); GameProcess game1=new GameProcess(area); game1.process(); } } 第二个Java文件: import java.util.Random; import java.util.Scanner;
public class GameProcess { int area,i,arrcount,right,midright,t; int base[]=new int[arrcount],userNum[]=new int[area],sysNum[]=new int[area]; Random random=new Random(); Scanner reader=new Scanner(System.in); GameProcess(int a) { area=a; arrcount=10; right=0;
初级程序员
by: 云代码会员 发表于:2016-08-01 09:49:07 顶(0) | 踩(0) 回复
哇
回复评论