Giter VIP home page Giter VIP logo

penney's Introduction

Penney's Game

built with Python3 PyPI version

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].

Here we have a friendly clone of this game that I wrote during coronavirus quarantine days.

PyPI Counter
Github Stars
Branch master dev
CI
Code Quality CodeFactor codebeat badge

Installation

Source Code

  • Download and install Python3.x (>=3.5)
    • Select Add to PATH option
    • Select Install pip option
  • Download Version 0.4 or Latest Source
  • 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

Easy Install

  • Run easy_install --upgrade penney (Need root access)

Exe Version (Windows)

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! :

Binder

  • 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 [email protected].

  • Please complete the issue template

Dependencies

master dev
Requirements Status Requirements Status

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

penney's People

Contributors

dependabot-preview[bot] avatar sadrasabouri avatar sepandhaghighi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

penney's Issues

Add Notebook

Description

Add Jupyter Notebook for online playing

More than one player ended with the same score

Description

When more than one player ended with the same score

Expected Behavior

Tie or more than one winner!!

Actual Behavior

penney-bug

Operating System

Windows 10

Python Version

Python 3.6

Penney Version (Use : penney.__version__)

Penney 0.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.