Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.40 KB | None | 0 0
  1. /*
  2. * Your name: Mark Krikunov
  3. * Date: 9.25.19
  4. * Course Name and Number: CSC-111
  5. * Problem Number: Extra Credit
  6. * Short Description of the Problem: Improved version of Rock paper scissors
  7. * Email Address: 19krikma@wtahs.com
  8. */
  9.  
  10. import java.util.Random;
  11. import java.util.Scanner;
  12.  
  13. public class RockPaperScissorsLizardSpock {
  14.  
  15. public static void main(String[] args) {
  16. //Input scanner
  17. Scanner input = new Scanner(System.in);
  18.  
  19. //Introduction
  20. System.out.println("Welcome to Rock Paper Scissors Lizard Spocky");
  21. System.out.println("Enjoy the game!");
  22. System.out.println("Version 2.0");
  23.  
  24. // Options numbered and input your choice
  25. System.out.print("scissor (0), rock (1), paper (2), lizard(3), spock(4): ");
  26. int ans = input.nextInt();
  27.  
  28. //Random number Generator for Answer
  29. Random radOp = new Random();
  30. int num = radOp.nextInt(5);
  31.  
  32. //Random Number Generator for Win Lost and Draw
  33. int wld = radOp.nextInt(2);
  34.  
  35. // holds options in number order
  36. String[] options = {"scissors" , "rock", "paper", "lizard", "spock"};
  37.  
  38. //Scissors Section for Won Lost and Draw
  39. String[] scissorsWon = {"Cut cut loser got a paper cut: You Win", "Scissors strike again: You Win"};
  40. String[] scissorsLost = {"Go collect metal shards, Dont get a cut: You Lost", "Go back and fix your angles: You Lost"};
  41. String[] scissorsDraw = {"What did you draw today: It's a Draw Bro", "Scissors dont cut Scissors, unless yours are not made of Adamantium"};
  42.  
  43. //Rock Sections for Won Lost and Draw
  44. String[] rockWon = {"All your enemies are crushed, Well Done: You Win", "Sorry you cant Roll but they got Trolled: You Win"};
  45. String[] rockLost = {"Hey you got a crack, stop till its all Stacked: You Lost", "Your dust, leave with wind: You Lost"};
  46. String[] rockDraw = {"Stop making Forest Fire, its no Good: Draw", "Made some Spark, ouch it probly hurst"};
  47.  
  48. //Paper Sections for Won Lost and Draw
  49. String[] paperWon = {"Ahh you cut, but stay sharp: You Win", "You enemies will need more than bandaite: You Win"};
  50. String[] paperLost = {"Your Sharp, but not as much as you thought you were: You Lost", "Fly away like a paper airplane: You Lost"};
  51. String[] paperDraw = {"Can Paper Cut Paper, its a question to us all: Draw", "This battle is unfair, move on: Draw"};
  52.  
  53. //Lizard Section for Won Lost and Draw
  54. String[] lizardWon = {"Okay you can keep a tail to your self: You Win", "You hiss is posines: You Win"};
  55. String[] lizardLost = {"Someones head is gone: You Lost", "Go and grow a new tail: You Lost"};
  56. String[] lizardDraw = {"Make out and make a new lizard: Draw", "Are you bitting your own tail or someone else: Draw"};
  57.  
  58. //Spock Section for Won Lost and Draw
  59. String[] spockWon = {"I crapped my pans spocky: You Win", "Hey, hey, let people breath or they will surely crap their pants: You Win"};
  60. String[] spockLost = {"I guess i dont need to do laundrey today: You Lost", "Good, I will not get bold today: You Lost"};
  61. String[] spockDraw = {"Is this the ned of the world or over done Halloween: Draw", "Sorry I probly pulled a mirror on you: Draw"};
  62.  
  63. //you choose scissors
  64. if (ans == 0) {
  65. if (num == 0) {
  66. System.out.println(scissorsDraw[wld]);
  67. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  68. }
  69. //computer choose rock
  70. else if (num == 1) {
  71. System.out.println(scissorsLost[wld]);
  72. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  73. }
  74. //computer choose paper
  75. else if (num == 2) {
  76. System.out.println(scissorsWon[wld]);
  77. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  78. }
  79. //computer choose lizard
  80. else if (num == 3) {
  81. System.out.println(scissorsWon[wld]);
  82. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  83. }
  84. //computer choose spock
  85. else if (num == 4) {
  86. System.out.println(scissorsLost[wld]);
  87. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  88. }
  89. }
  90.  
  91. //you choose rock
  92. else if (ans == 1) {
  93.  
  94. //computer choose scissors
  95. if (num == 0) {
  96. System.out.println(rockWon[wld]);
  97. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  98. }
  99. //computer choose rock
  100. else if (num == 1) {
  101. System.out.println(rockDraw[wld]);
  102. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  103. }
  104. //computer choose paper
  105. else if (num == 2) {
  106. System.out.println(rockLost[wld]);
  107. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  108. }
  109. //computer choose lizard
  110. else if (num == 3) {
  111. System.out.println(rockWon[wld]);
  112. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  113. }
  114. //computer choose spock
  115. else if (num == 4) {
  116. System.out.println(rockLost[wld]);
  117. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  118. }
  119. }
  120.  
  121. //you choose paper
  122. else if (ans == 2) {
  123.  
  124. //computer choose scissors
  125. if (num == 0) {
  126. System.out.println(paperLost[wld]);
  127. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  128. }
  129. //computer choose rock
  130. else if (num == 1) {
  131. System.out.println(paperWon[wld]);
  132. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  133. }
  134. //computer choose paper
  135. else if (num == 2) {
  136. System.out.println(paperDraw[wld]);
  137. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  138. }
  139. //computer choose lizard
  140. else if (num == 3) {
  141. System.out.println(paperLost[wld]);
  142. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  143. }
  144. //computer choose spock
  145. else if (num == 4) {
  146. System.out.println(paperWon[wld]);
  147. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  148. }
  149. }
  150.  
  151. //you choose lizard
  152. else if (ans == 3) {
  153.  
  154. //compuer choose scissors
  155. if (num == 0) {
  156. System.out.println(lizardLost[wld]);
  157. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  158. }
  159. //computer choose rock
  160. else if (num == 1) {
  161. System.out.println(lizardLost[wld]);
  162. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  163. }
  164. //computer choose paper
  165. else if (num == 2) {
  166. System.out.println(lizardWon[wld]);
  167. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  168. }
  169. //computer choose lizard
  170. else if (num == 3) {
  171. System.out.println(lizardDraw[wld]);
  172. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  173. }
  174. //computer choose spock
  175. else if (num == 4) {
  176. System.out.println(lizardWon[wld]);
  177. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  178. }
  179. }
  180.  
  181. //you choose spock
  182. else if (ans == 4) {
  183.  
  184. //computer choose scissors
  185. if (num == 0) {
  186. System.out.println(spockWon[wld]);
  187. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  188. }
  189. //computer choose rock
  190. else if (num == 1) {
  191. System.out.println(spockWon[wld]);
  192. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  193. }
  194. //computer choose paper
  195. else if (num == 2) {
  196. System.out.println(spockLost[wld]);
  197. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  198. }
  199. //computer choose lizard
  200. else if (num == 3) {
  201. System.out.println(spockLost[wld]);
  202. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  203. }
  204. //computer choose spock
  205. else if (num == 4) {
  206. System.out.println(spockDraw[wld]);
  207. System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
  208. }
  209. }
  210. //If person choose number outside the option list
  211. else {
  212. System.out.println("WARNING: Wrong number typed. You dum dum.");
  213. }
  214. input.close();
  215.  
  216. }
  217.  
  218. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement