Code Monkey home page Code Monkey logo

pig-dice's Introduction

Pig Dice

This programming project implements a simple clone of the popular game Pass the Pig© and PigMania©.

The main objective with this assignemnt is to introduce separate compiling, progressive programming (small versions towards the final full-fledged program), as well as to provide an oportunity to develop a project using the tools already taught such as git and cmake.

The Gameplay

Pig is a folk jeopardy dice game described by John Scarne in 1945, in which two players compete to reach 100 points first.

The game is organized in turns. Each turn, the same player keeps rolling the dice, while the face points are accmulated into a turn total, until one of these two conditions happen:

  1. The current player decides to hold, in which case s/he scores the turn total; or,
  2. The face ⚀, (the pig) is rolled, in which case the current player scores nothing.

In both cases, the turn total is set to zero and it becomes the opponent's turn.

In summary, any time during a player's turn, s/he must take one of these two actions:

  • Roll the dice, which may produce:
    • Face ⚀: the player scores nothing and it becomes the opponent's turn;
    • Faces ⚁, ⚂, ⚃, ⚄, or ⚅: the face point is added to the turn total and the player's turn continues.
  • Hold
    • The turn total is added to the player's overall score and it becomes the opponent's turn.

The player who scores 100 or more points at the end of a turn is the winner.

How to use

Dependencies

  • cmake
  • make
  • g++

Compile

To compile the project, first you need to clone th repository with

git clone https://github.com/matheusmas132/Pig-Dice.git

or download the project manualy.

Go to project directory and use

mkdir build && cd build
cmake ../
make

Run

Type ./PigDice to run and enjoy!

Authorship

Program developed by Matheus de Andrade and Felipe Medeiros, 2019.1

© IMD/UFRN 2017.

pig-dice's People

Contributors

mathdesilva avatar felipecolares22 avatar

Watchers

James Cloos avatar

Forkers

felipecolares22

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.