A two-player game of pig. Roll the dice and try to beat your opponent to 100! But don't roll a 1, or you'll lose all your points for that turn.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
.DS_Store
README.md
Thumbs.db
composer.json
favicon.ico
index.html
index.php

README.md

Illegal Dice Game

Illegal Dice Game

GAME RULES:

  • The game has 2 players, playing in rounds.
  • Enter the number of points you wish to be the winning score. (If no points are entered, default winning score is 100.)
  • In each turn, a player rolls the dice as many times as they wish. Each result gets added to their ROUND score.
  • The player can choose to 'Hold', which means that their ROUND score gets added to their GLOBAL score. After that, it's the next player's turn.
  • BUT...
    • If the player rolls a 1, their ROUND score is reset to zero and it's the next player's turn.
    • If the player rolls two sixes, both their ROUND score and GLOBAL score are reset to zero and it's the next player's turn.
  • The first player to reach 100 points (or whatever you've set it to) in their GLOBAL score wins the game.

NEW CODING SKILLS LEARNED:

  • Ternary operators.
  • State variables.
  • querySelectors.

FUTURE ITERATIONS:

  • Add link to my portfolio.
  • Add link to my GitHub.
  • Add gameplay instructions to UI.