This is supposed to be a rock paper scissor game, there's more to the code after, but I don't have to change anything on it.
I'm a little confused on how to use the Scanner to collect user input without using Strings. The comments are the instructions that I'm supposed to follow to finish the code/ some of my comments to point out the problem area.
import java.util.Scanner;
public class RPSGame {
// 1 is Rock
// 2 is Paper
// 3 is Scissors
public static void main(String[] args) {
String startMessage ="****************************START*******************************\n";
String endMessage = "\n****************************END*******************************\n";
System.out.println(startMessage);
Scanner scnr = new Scanner(System.in);
//**************************** DO NOT MODIFY ANYTHING BEFORE THIS LINE*****************************
// To-Do: Add print statement to welcome User to the game
System.out.println("Welcome to the RPS game! Are you ready?");
// To-Do: Add print statement prompting User to enter 1, 2, or 3 (explain which each number represents)
System.out.println("Enter a number between 1 and 3. 1 is for Rock, 2 for Paper and 3 for Scissors ");
// To-Do: Use scnr.nextInt() to collect user input, save it as an int variable called choice
int java.util.scnr.nextInt choice; //I'm stuck on this part of the line, how am I supposed //to use to collect user input without using Strings?(that was part of the requirement for the //assignment?) I'm still pretty new to this and idk what to put/change for this line.
// To-Do: Complete the following line using Math.Random() to generate a int
// In the range 1-3
int computerChoice = ((int)(Math.random())*3); //Idk if I did this part right