This C# console application implements the popular game "Rock, Paper, Scissors, Lizard, Spock" where players can compete against the computer. The game includes rules, scoring, and interactive gameplay.
In this game, players can choose from five options: Rock, Paper, Scissors, Lizard, or Spock. Each option has different interactions with the others, leading to various outcomes. The game is played over a series of rounds, with the first player to win the majority of rounds declared the winner.
To run the game, ensure you have the .NET SDK installed on your machine.
-
Clone the repository:
git clone https://github.com/yourusername/rock-paper-scissors-lizard-spock.git
-
Navigate to the project directory:
cd rock-paper-scissors-lizard-spock
-
Build the project:
dotnet build
-
Run the game:
dotnet run
Rock
crushesLizard
,Rock
crushesScissors
,Rock
gets vaporized bySpock
,Rock
gets covered byPaper
.Paper
coversRock
,Paper
disprovesSpock
,Paper
gets eaten byLizard
,Paper
gets cut byScissors
.Scissor
cutPaper
,Scissors
decapitateLizard
,Scissors
get crushed byRock
,Scissors
get smashed bySpock
.Lizard
poisonsSpock
,Lizard
eatsPaper
,Lizard
gets crushed byRock
,Lizard
gets decapitated byScissors
.Spock
smashesScissors
,Spock
vaporizesRock
,Spock
gets poisoned byLizard
,Spock
gets disproven byPaper
.
- The game starts with a greeting message and displays the rules.
- Each round, the player is prompted to make a selection (1-5) for Rock, Paper, Scissors, Lizard, or Spock.
- The computer randomly selects an option.
- The game processes the results and displays who wins the round.
- Scores are updated based on the round's outcome.
- The game continues for a set number of rounds (default: 5).
- At the end of the rounds, the final score is displayed, and the winner (or tie) is announced.
- Players have the option to play again.
Game.cs
: Contains the main game logic and flow.resultTable
: Defines the outcomes of player and computer selections.reasonTable
: Describes the reason for each round's result.Greeting()
: Displays the game rules and greets the player.DisplayCurrentScore()
: Shows the current score during gameplay.PlayerSelection()
: Prompts the player to make a selection.CompSelection()
: Generates a random selection for the computer.processResult()
: Determines the result of each round.displayResults()
: Displays the final game results.