~/Rock-Paper-Scissors · Since 2020
Rock-Paper-Scissors
Rock-Paper-Scissors against a CPU that learns how you play.
The same game written twice, years apart. On the hardest level the CPU uses Markov chains to learn your patterns, and it also plays Rock-Paper-Scissors-Lizard-Spock.
GitHub ActionsPythonTkinter
Versions
v12020
One 118-line script with random.choice.
v22026
Three levels; the hardest learns your patterns with Markov chains.
What changed
| Aspect | Before | After |
|---|---|---|
| CPU | random.choice | → Learns your patterns with Markov chains |
| Rules | Hand-written if/else for every move | → Rules are data: Lizard-Spock took a table, not code |
| Structure | One 118-line script | → Package split into rules, AI, match, stats and GUI |
| Tests | None | → 30+ pytest tests on GitHub Actions |