https://github.com/sepandhaghighi/penney
Penney's Game
https://github.com/sepandhaghighi/penney
cli cli-game cli-games console-application console-game fun game linux macos penney-game penneygame probability python python3 windows
Last synced: 7 months ago
JSON representation
Penney's Game
- Host: GitHub
- URL: https://github.com/sepandhaghighi/penney
- Owner: sepandhaghighi
- License: mit
- Created: 2020-03-20T19:29:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T01:31:13.000Z (over 1 year ago)
- Last Synced: 2025-04-14T19:56:00.398Z (7 months ago)
- Topics: cli, cli-game, cli-games, console-application, console-game, fun, game, linux, macos, penney-game, penneygame, probability, python, python3, windows
- Language: Python
- Homepage:
- Size: 1.03 MB
- Stars: 27
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Authors: AUTHORS.md
Awesome Lists containing this project
README
----------
## Overview
Penney's game, named after its inventor Walter Penney, is a binary (head/tail) sequence generating game between two or more players. Player A selects a sequence of heads and tails (of length 3 or larger), and shows this sequence to player B. Player B then selects another sequence of heads and tails of the same length. Subsequently, a fair coin is tossed until either player A's or player B's sequence appears as a consecutive subsequence of the coin toss outcomes. The player whose sequence appears first wins [[Wikipedia](https://en.wikipedia.org/wiki/Penney%27s_game)].
Here we have a friendly clone of this game that I wrote during coronavirus quarantine days.
Branch
master
dev
CI
## Installation
### Source Code
- Download and install [Python3.x](https://www.python.org/downloads/) (>=3.5)
- [x] Select `Add to PATH` option
- [x] Select `Install pip` option
- Download [Version 0.4](https://github.com/sepandhaghighi/penney/archive/v0.4.zip) or [Latest Source ](https://github.com/sepandhaghighi/penney/archive/dev.zip)
- Run `pip install -r requirements.txt` or `pip3 install -r requirements.txt` (Need root access)
- Run `python3 setup.py install` or `python setup.py install` (Need root access)
### PyPI
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- Run `pip install penney` or `pip3 install penney` (Need root access)
### Easy Install
- Run `easy_install --upgrade penney` (Need root access)
### Exe Version (Windows)
- Download [Exe-Version 0.4](https://github.com/sepandhaghighi/penney/releases/download/v0.4/Penney-0.4.exe)
- Run `Penney-0.4.exe`
## How to Play
- Open `CMD` (Windows) or `Terminal` (UNIX)
- Run `python -m penney` or `python3 -m penney` (or run **executable** version)
GIF
## Try Penney in Your Browser!
You can play Penney's game online in interactive Jupyter Notebooks via the Binder service! Try it out now! :
[](https://mybinder.org/v2/gh/sepandhaghighi/penney/master)
- Open `Notebook.ipynb`
## Contribution
Changes and improvements are more than welcome! ❤️ Feel free to fork and open a pull request.
Please consider the following :
1. Fork it!
2. Create your feature branch (under `dev` branch)
3. Add your functions/methods to proper files
4. Pass all CI tests
5. Update `CHANGELOG.md`
- Describe changes under `[Unreleased]` section
6. Submit a pull request into `dev` (please complete the pull request template)
## Issues & Bug Reports
Just fill an issue and describe it. I'll check it ASAP!
or send an email to [sepand@pycm.ir](mailto:sepand@pycm.ir "sepand@pycm.ir").
* Please complete the issue template
## Dependencies
## References
1- Penney, Walter. "Problem 95: penney-ante." Journal of Recreational Mathematics 7 (1974): 321.
2- Zajkowski, Krzysztof. "Penney's game between many players." arXiv preprint arXiv:1212.3973 (2012).
3- Guy, R. K., and John Horton Conway. Winning Ways for your Mathematical Plays. Academic Press, London, 1982.
4- Humble, Steve, and Yutaka Nishiyama. "Humble-Nishiyama Randomness Game-A New Variation on Penney's Coin Game." (2010).
## Show Your Support
Star This Repo
Give a ⭐️ if this project helped you!
Donate to Our Project
Bitcoin
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy
Ethereum
0xcD4Db18B6664A9662123D4307B074aE968535388
Litecoin
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ
Doge
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh
Tron
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7
Ripple
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq
Binance Coin
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef
Tether
0xcD4Db18B6664A9662123D4307B074aE968535388
Dash
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s
Stellar
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL