Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package co.harvey;
- import java.util.Random;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- String[] thisIsAStringArray = {"Rock","Paper","Scissors"};
- Random rand = new Random();
- int n = rand.nextInt(3);
- String computerAnswer = thisIsAStringArray[n];
- System.out.println(computerAnswer);
- System.out.println("Enter Rock, Paper Or Scissors");
- Scanner sc = new Scanner(System.in);
- String userInput = sc.nextLine();
- userInput = userInput.toLowerCase();
- if(userInput.equals(computerAnswer)){
- System.out.println("Computer Has Also Chosen: " + computerAnswer);
- System.out.println("It's A Draw!!");
- }
- if(userInput.equals("Rock")){
- else if(){
- }
- }
- }
- }
- //if(userInput == "rock"){
- //else if(){
- //}
- //else if{
- //}
- //else if{
- //}
- //}
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement