Code Monkey home page Code Monkey logo

pig's Introduction

WELCOME TO PIG

Game rules

The objective of Pig is to be the first player to earn 100 points.

This is achieved by rolling the dice (D6) and adding the rolled values.

Players are permitted to roll as many times as they’d like during their turn, but beware of rolling a 1! Doing so will cost you all the points you’ve collected during your turn.

If you’ve racked up the points and don’t want to risk rolling a 1, you may choose to hold and keep the numbers you’ve accumulated during your turn. It will be up to you to decide if the risk is worth it! Once a player reaches 100 points, the game ends and that player is the winner.

Requirements and recommendations

  • Requires Python version 3.8 or higher
  • Functioning keyboard with alphanumeric keys.
  • Given that the program uses ASCII art, it is highly recommended running this in a fullscreen terminal.
  • Your smart fridge could run this program, so I'm not even gonna list hardware requirements.

Usage

Run pig.py in a terminal

python3 src/pigpy

Alternatively, build from Test Pypi by running:

pip install -i https://test.pypi.org/simple/ pig-JoseEscauriza

Once running, the player will first be prompted to enter their name.

Afterwards a menu will be displayed, prompting the user to pick from one of its 4 options:

  1. ROLL - Rolls the dice, if the dice lands in 1 the turn is forfeit, otherwise the player sees the menu again.

  2. HOLD - Player's current score (a.k.a turn score) is passed onto the player's global score, thereby being held safe.

  3. VIEW POINTS - Player will see their global score displayed on screen, afterwards the menu is shown again (turn is NOT lost).

  4. EXIT - Quit the program.

Have fun!

pig's People

Contributors

joseescauriza avatar

Watchers

 avatar

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.