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;
}


}

08-29 13:40