Anonymous Anonymous - 6 months ago
1434 0

No description

Java

Object

package Janken;

import java.util.*;

public class BottyBot {
    protected static int botNum;
    protected static String botChoice;

    protected static void choose() {
        Random rand = new Random();
        botNum = rand.nextInt(3) + 1;
        if (botNum == 1) {
            botChoice = "rock";
        } else if (botNum == 2) {
            botChoice = "paper";
        } else if (botNum == 3) {
            botChoice = "Scissors";
        } else {
            System.out.println("Error Statement - choose(out of range), check code/restart program");
        }
    }
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download