https://github.com/syniol/rock-paper-scissors-lizard-spock
Rock, Paper, Scissors, Lizard, and Spock CLI Game in Go (Golang)
https://github.com/syniol/rock-paper-scissors-lizard-spock
cli command-line-tool game go golang rock-paper-scissors-game rock-paper-scissors-lizard-spock
Last synced: 6 months ago
JSON representation
Rock, Paper, Scissors, Lizard, and Spock CLI Game in Go (Golang)
- Host: GitHub
- URL: https://github.com/syniol/rock-paper-scissors-lizard-spock
- Owner: syniol
- Created: 2025-11-28T15:41:07.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-18T11:05:01.000Z (6 months ago)
- Last Synced: 2026-01-13T19:49:44.300Z (6 months ago)
- Topics: cli, command-line-tool, game, go, golang, rock-paper-scissors-game, rock-paper-scissors-lizard-spock
- Language: Go
- Homepage: https://syniol.com
- Size: 3.43 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rock, Paper, Scissors, Lizard, Spock in Go (GoLang)
 
The game invented by Sam Kass with his wife Karen Bryla is played between two players. Each player chooses one of the five options:
- **Rock**
- **Paper**
- **Scissors**
- **Lizard**
- **Spock**
The winner is determined by the following rules:
| **Choice** | **Wins Against** | **Reason** |
|--------------|------------------|----------------------------------|
| **Scissors** | Paper, Lizard | Cuts Paper, Decapitates Lizard |
| **Paper** | Rock, Spock | Covers Rock, Disproves Spock |
| **Rock** | Scissors, Lizard | Crushes Scissors, Crushes Lizard |
| **Lizard** | Paper, Spock | Eats Paper, Poisons Spock |
| **Spock** | Scissors, Rock | Smashes Scissors, Vaporizes Rock |
If both players choose the same option, the game results in a **tie**.
## Features and Acceptance Criteria
- [X] **Interactive Gameplay**: Players can select their choice, and the winner is determined based on the rules.
- [X] **Clear Visual Feedback**: Winning and losing outcomes are displayed in an engaging and intuitive way.
- [X] **Scoreboard**: Tracks the points of the user and the computer across multiple rounds.
- [X] **Data Persistence**: Retains the game state and scoreboard.
- [X] **Restart**: Allows the user to restart the game, clearing the scoreboard and resetting the game state.
## Motivation
I recently got asked to come in for a second interview at this awesome robotics company in London. I was super pumped about what they do.
However, the pair programming exercise could be pretty tough for me. I struggle with stress, and they switched up the technical challenge
at the last minute. The engineer assigned to the exercise seemed really nice, though. I think he was a bit let down, but he had no idea
about my ADD, which I always keep under wraps. I even flunked my motorbike test nine times before finally passing, and I never mentioned
my condition to the examiner.
This was one of their take-home exercises that I started but never got to demo, and I ended up failing the pairing exercise. I wrapped it
up just to save face, hoping the engineers at that company might see that I'm not as bad as I seem, haha.
## Up and Running
You can download the compiled binary for your operating system from [the release page](https://github.com/syniol/rock-paper-scissors-lizard-spock/releases). You could
also download and build from source code. You need to have a Go installation for version `1.24.x`.
```shell
./rpsls-cli-mac-os-arm64
```
For Unix based operating systems you could use:
```shell
make run
```
For Windows, please use the following command:
```shell
go run cmd\cli.go
```
### Dependencies
* [CLI Forms](https://github.com/charmbracelet/huh)
* [CLI Table Colour Format](https://github.com/fatih/color)
* [CLI Table Display](https://github.com/rodaine/table)
#### Credits
Author: [Hadi Tajallaei _(Genius Persian Child)_](mailto:hadi@syniol.com)
Copyright © 2025 Syniol Limited. All rights reserved.

