Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package co.harvey;
  2.  
  3. import java.util.Random;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) {
  9. String[] thisIsAStringArray = {"Rock","Paper","Scissors"};
  10. Random rand = new Random();
  11. int n = rand.nextInt(3);
  12. String computerAnswer = thisIsAStringArray[n];
  13. System.out.println(computerAnswer);
  14. System.out.println("Enter Rock, Paper Or Scissors");
  15. Scanner sc = new Scanner(System.in);
  16. String userInput = sc.nextLine();
  17. userInput = userInput.toLowerCase();
  18. if(userInput.equals(computerAnswer)){
  19. System.out.println("Computer Has Also Chosen: " + computerAnswer);
  20. System.out.println("It's A Draw!!");
  21. }
  22. if(userInput.equals("Rock")){
  23. else if(){
  24.  
  25. }
  26.  
  27. }
  28. }
  29. }
  30.  
  31.  
  32. //if(userInput == "rock"){
  33. //else if(){
  34.  
  35. //}
  36. //else if{
  37.  
  38. //}
  39. //else if{
  40.  
  41. //}
  42. //}
  43.  
  44.  
  45. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement