Well, this code is kind of messy. But I think the only problem in this code is the int bot =(int)(Math.random()*3); . Did I do it right? Btw, if there is a way better way to make a Rock Paper Sissor code, can you give me a hint on how I could better code this?
import java.util.Scanner; public class Application2 { public static void main(String[] args) { System.out.println("Let's play a game of Rock Paper Sissor!"); Scanner scanner = new Scanner (System.in); System.out.println("Rock Paper Sissor: "); String rps=scanner.nextLine(); int bot = (int) (Math.random()*3); //Get a number from 1-3. if (rps == "Rock") { if (bot==1) //if number from Math.random is 1. { System.out.println ("Bot: Rock. TIE!"); } if (bot==2) { System.out.println ("Bot: Paper. You Lose!"); } if (bot==3) { System.out.println ("Bot: Sissor. You Win!"); } } if (rps == "Paper") { if (bot==1) { System.out.println ("Bot: Rock. You Win!"); } if (bot == 2) { System.out.println ("Bot: Paper. TIE!"); } if (bot == 3) { System.out.println ("Bot: Sissor. You Lose!"); } if (rps == "Sissor") { if (bot==1) { System.out.println ("Bot: Rock. You Lose!"); } if (bot==2) { System.out.println ("Bot: Paper. You Win!"); } if (bot==3) { System.out.println ("Bot: Sissor. TIE!"); } } } } }