https://github.com/will-wow/chopsticks
Plays the chopsticks hand game
https://github.com/will-wow/chopsticks
elixir game
Last synced: 10 months ago
JSON representation
Plays the chopsticks hand game
- Host: GitHub
- URL: https://github.com/will-wow/chopsticks
- Owner: will-wow
- License: mit
- Created: 2016-09-14T23:25:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T01:06:11.000Z (over 9 years ago)
- Last Synced: 2025-02-05T14:46:12.569Z (over 1 year ago)
- Topics: elixir, game
- Language: Elixir
- Size: 1.2 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Plays the Chopsticks hand game
To play against another human:
`mix run -e Chopsticks.Play.play`
To play against the computer:
`mix run -e Chopsticks.AiPlay.play`
Rules:
- Each player starts with 1 of 5 possible fingers up on each hand.
- On each turn, one player gives the number of up fingers on one hand to one of the other player's hands.
- If a hand has exactly 5 fingers up, all are knocked down.
- If a hand plus the given fingers is more than 5, the new number is old + added mod 5
- If a player has an even number of fingers on one hand, and no fingers on the other hand,
they may use their turn to split their fingers evenly.
- The goal is to knock both the other player's hands to 0.