JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
import java.util.NoSuchElementException;
/** Created by Dan Walker */
/** INSTRUCTIONS
*
* Program requires 2 inputs, type in the game mode followed by
* the token you want to play
*
* Game Modes:
* - normal
* - extended
* - elemental
*
* Tokens (corresponding to each GameMode):
* - rock, paper, scissors
* - rock, paper, scissors, lizard, spock
* - fire, water, earth, lightning
*/
/** This is a grossly overcomplicated way to code a Rock Paper Scissors game
* (goes by the name of Janken in Japan, hence the name of the first class).
*
* What I wanted to do was utilise some Java object oriented behavior
* instead of using lots of if/else and switch clauses. By using polymorphism
* you can allow the objects themselves to decide what happens. Want to make
* a different version of the game? Swap out the objects for new ones. The top
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run