package java_人机猜拳001;

import java.util.Scanner;

public class Computer {
public static String computerName;
public static int computerIntegral;
public void setCompputerName (String computerName) {
this.computerName = computerName;
}
public String getComeputerName() {
return computerName;
}
public void setComputerIntegral(int computerIntegral) {
this.computerIntegral = computerIntegral;
}
public int getComeputerIntegral() {
return computerIntegral;
}
public int computerHand() {
Scanner sc = new Scanner(System.in);
System.out.println( computerName +"猜拳!");
int radom = (int)(Math.random()*3+1);
switch(radom) {
case 1 :
System.out.println("剪刀");
break;
case 2 :
System.out.println("石头");
break;
case 3 :
System.out.println("布");
break;
default:
System.out.println("错误!");
break;
}
return radom;
}


}

 posted on 2019-06-21 17:49  黑猫007  阅读(336)  评论(0编辑  收藏  举报