Skip to content

idontreallywolf/pigdice-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pig-Dice Game

Project Description:

The purpose of the project is to learn how to collabrate in a team and exercise writing clean and testable code.

pigdice_image

Installation

1. Clone repository

git clone https://github.com/idontreallywolf/pigdice-py

2. Navigate to the repository

cd pigdice-py

3. Setup virtual env.

make venv

4. Activate virutal env.

On windows

.venv/Scripts/activate

Linux/OSX

source .venv/bin/activate

5. Install dependencies

make install

6. Run the application

Best performance in PowerShell or Unix Terminal

make run

Tests

Run all tests

make test

Run specific tests

make pylint
make flake8

.. or both pylint and flake8:

make lint

Unittests

make unittest

show coverage report

make coverage-report

Documentation

Generate HTML documentatiion

make pdoc

Generate UML diagram (Execute only in Git Bash)

make pyreverse

Generate Metrics (Execute only in Git Bash)

make metrics

Command Options:

The game offers five options: exit, help, highscore, rules, and start

The exit option closes the application, help provides inforamtion on commands, highscore displays the high score table, rules provides the rules of the game, and start begins the game.

About the game

Game Options:

Options Description
Hold Save the turn socre to total score
Roll Roll the dice
Cheat Win the game
End Game
Change Name Change the current player's name

Game description

Each turn, a player repeatedly rolls a dice until either a 1 is rolled or the player decides to "hold":

  • If the player rolls a 1, they score nothing and it becomes the next player's turn.
  • If the player rolls any other number, it is added to their turn total and the player's turn continues.
  • If a player chooses to "hold", their turn total is added to their score, and it becomes the next player's turn.

The first player to score 100 or more points wins. Wikipedia (Pig dice game)

AI Player:

The AI player will choose to roll as long as it's current score is less than threshold score.

Project Creators:

The project was created by Beilan Guo and Nedim Kanat, who attended the "Methods for Sustainable Programming" course at Kristianstad University.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published