Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Your name: Mark Krikunov
- * Date: 9.25.19
- * Course Name and Number: CSC-111
- * Problem Number: Extra Credit
- * Short Description of the Problem: Improved version of Rock paper scissors
- * Email Address: 19krikma@wtahs.com
- */
- import java.util.Random;
- import java.util.Scanner;
- public class RockPaperScissorsLizardSpock {
- public static void main(String[] args) {
- //Input scanner
- Scanner input = new Scanner(System.in);
- //Introduction
- System.out.println("Welcome to Rock Paper Scissors Lizard Spocky");
- System.out.println("Enjoy the game!");
- System.out.println("Version 2.0");
- // Options numbered and input your choice
- System.out.print("scissor (0), rock (1), paper (2), lizard(3), spock(4): ");
- int ans = input.nextInt();
- //Random number Generator for Answer
- Random radOp = new Random();
- int num = radOp.nextInt(5);
- //Random Number Generator for Win Lost and Draw
- int wld = radOp.nextInt(2);
- // holds options in number order
- String[] options = {"scissors" , "rock", "paper", "lizard", "spock"};
- //Scissors Section for Won Lost and Draw
- String[] scissorsWon = {"Cut cut loser got a paper cut: You Win", "Scissors strike again: You Win"};
- String[] scissorsLost = {"Go collect metal shards, Dont get a cut: You Lost", "Go back and fix your angles: You Lost"};
- String[] scissorsDraw = {"What did you draw today: It's a Draw Bro", "Scissors dont cut Scissors, unless yours are not made of Adamantium"};
- //Rock Sections for Won Lost and Draw
- String[] rockWon = {"All your enemies are crushed, Well Done: You Win", "Sorry you cant Roll but they got Trolled: You Win"};
- String[] rockLost = {"Hey you got a crack, stop till its all Stacked: You Lost", "Your dust, leave with wind: You Lost"};
- String[] rockDraw = {"Stop making Forest Fire, its no Good: Draw", "Made some Spark, ouch it probly hurst"};
- //Paper Sections for Won Lost and Draw
- String[] paperWon = {"Ahh you cut, but stay sharp: You Win", "You enemies will need more than bandaite: You Win"};
- String[] paperLost = {"Your Sharp, but not as much as you thought you were: You Lost", "Fly away like a paper airplane: You Lost"};
- String[] paperDraw = {"Can Paper Cut Paper, its a question to us all: Draw", "This battle is unfair, move on: Draw"};
- //Lizard Section for Won Lost and Draw
- String[] lizardWon = {"Okay you can keep a tail to your self: You Win", "You hiss is posines: You Win"};
- String[] lizardLost = {"Someones head is gone: You Lost", "Go and grow a new tail: You Lost"};
- String[] lizardDraw = {"Make out and make a new lizard: Draw", "Are you bitting your own tail or someone else: Draw"};
- //Spock Section for Won Lost and Draw
- String[] spockWon = {"I crapped my pans spocky: You Win", "Hey, hey, let people breath or they will surely crap their pants: You Win"};
- String[] spockLost = {"I guess i dont need to do laundrey today: You Lost", "Good, I will not get bold today: You Lost"};
- String[] spockDraw = {"Is this the ned of the world or over done Halloween: Draw", "Sorry I probly pulled a mirror on you: Draw"};
- //you choose scissors
- if (ans == 0) {
- if (num == 0) {
- System.out.println(scissorsDraw[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose rock
- else if (num == 1) {
- System.out.println(scissorsLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose paper
- else if (num == 2) {
- System.out.println(scissorsWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose lizard
- else if (num == 3) {
- System.out.println(scissorsWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose spock
- else if (num == 4) {
- System.out.println(scissorsLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- }
- //you choose rock
- else if (ans == 1) {
- //computer choose scissors
- if (num == 0) {
- System.out.println(rockWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose rock
- else if (num == 1) {
- System.out.println(rockDraw[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose paper
- else if (num == 2) {
- System.out.println(rockLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose lizard
- else if (num == 3) {
- System.out.println(rockWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose spock
- else if (num == 4) {
- System.out.println(rockLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- }
- //you choose paper
- else if (ans == 2) {
- //computer choose scissors
- if (num == 0) {
- System.out.println(paperLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose rock
- else if (num == 1) {
- System.out.println(paperWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose paper
- else if (num == 2) {
- System.out.println(paperDraw[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose lizard
- else if (num == 3) {
- System.out.println(paperLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose spock
- else if (num == 4) {
- System.out.println(paperWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- }
- //you choose lizard
- else if (ans == 3) {
- //compuer choose scissors
- if (num == 0) {
- System.out.println(lizardLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose rock
- else if (num == 1) {
- System.out.println(lizardLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose paper
- else if (num == 2) {
- System.out.println(lizardWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose lizard
- else if (num == 3) {
- System.out.println(lizardDraw[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose spock
- else if (num == 4) {
- System.out.println(lizardWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- }
- //you choose spock
- else if (ans == 4) {
- //computer choose scissors
- if (num == 0) {
- System.out.println(spockWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose rock
- else if (num == 1) {
- System.out.println(spockWon[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose paper
- else if (num == 2) {
- System.out.println(spockLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose lizard
- else if (num == 3) {
- System.out.println(spockLost[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- //computer choose spock
- else if (num == 4) {
- System.out.println(spockDraw[wld]);
- System.out.println("Your hand: " + options[ans] + " | Computer hand: " + options[num]);
- }
- }
- //If person choose number outside the option list
- else {
- System.out.println("WARNING: Wrong number typed. You dum dum.");
- }
- input.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement