RPS/Thecomputer.java

38 lines
1.0 KiB
Java

import java.util.Random;
public class Thecomputer {
static boolean airock = false;
static boolean aipaper = false;
static boolean aiscissors = false;
public static void generate(String[] args) {
Random random = new Random();
int randomnumber = random.nextInt(3);
if(randomnumber == 1) {
aipaper = true;
if(aipaper = true) {
airock = false;
aiscissors = false;
System.out.println("aipaper is true");
}
}
if(randomnumber == 0) {
aiscissors = true;
if(aiscissors = true) {
airock = false;
aipaper = false;
System.out.println("aiscissors is true");
}
}
if(randomnumber == 2) {
airock = true;
if(airock = true) {
aiscissors = false;
aipaper = false;
System.out.println("airock is true");
}
}
}
}