This is a simple implementation of the game Rock Paper Scissors Lizard Spock in Go.
Run locally
- Clone the files.
- Open the console, stand on the root folder of this project and type: go run main.go
- Paste on your browser: http://localhost:8080/
- Play.
You can also run the Docker image or the Makefile.
- Scissors cuts Paper
- Paper covers Rock
- Rock crushes Lizard
- Lizard poisons Spock
- Spock smashes Scissors
- Scissors decapitates Lizard
- Lizard eats Paper
- Paper disproves Spock
- Spock vaporizes Rock
- Rock crushes Scissors
Each game play scoreboard is reset automatically after 10 rounds.
- Player vs Computer
- Multiplayer (2 players maximum)
Base URL: https://rock-paper-sc.herokuapp.com
- /choices [GET] - Get all choices
[
{
"id": 1,
"name": "Rock"
},
{
"id": 5,
"name": "Spock"
}
]
- /choice [GET] - Get a random choice
{
"id": 1,
"name": "Rock"
}
- /play [POST] - Play a game
{
"player": 2
}
{
"player": 2,
"computer": 4,
"results": "lose",
"player_score": 2,
"computer_score": 6,
"total_rounds": 9,
"message": "Final round"
}
- /multiplayer [POST] - Play a multiplayer game
{
"player1":2,
"player2":5
}
{
"player1": 2,
"player2": 3,
"results": "Player 2 wins",
"player1_score": 0,
"player2_score": 1,
"total_rounds": 1,
"message": "Game in progress"
}
- /reset [GET] - Reset the game
{
"message": "Game reset successfully"
}
Sam Kass & Karen Bryla http://www.samkass.com/theories/RPSSL.html