Skip to content

TimEmpey/pig-dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pig Dice

By Tim Empey and Ted Gold

Allows users to play Pig Dice

Github Pages:

Technologies Used

  • JavaScript
  • HTML
  • CSS
  • Bootstrap

Description

Starts with two input boxes for users names which are collected with the submit button prompting the score boards to be un-hidden. Two buttons to roll or hold appear allowing users to roll, which logs the number to your turn score and hold which adds your turn score to the total. Rolling a 1 or pressing hold moves the buttons to the second player initiating their turn. First to 100 points wins. This is the wikipedia page to the game: https://en.wikipedia.org/wiki/Pig_%28dice_game%29

Setup/Installation Requirements

  • Open up your terminal and navigate to the desired landing folder
  • In terminal enter, ' "git clone https://github.com/TimEmpey/pig-dice '
  • In terminal enter 'code .' to open files in Visual Studio Code
  • In Visual Code Studio select the 'Go Live' option on the bottom task bar

Known Bugs

  • There are no known issues

Tests

Tests Describe: diceRoll();
Test 1: Should result in random number from 1-6
Code:
diceRoll(1,7);
Expected Output: 1 || 2 || 3 || 4 || 5 || 6

Describe: Player();
Test 1: Should result in random number from 1-6 for Player.
Code:
Player.diceRoll();
Expected Output: 1 || 2 || 3 || 4 || 5 || 6

Describe: rollArray;
Test 1: Should create an empty array.
Code:
playerOne.rollArray;
Expected Output: []
Test 2: Should populate array with rolled numbers
Code:
playerOne.roll(1,2,3); playerOne.rollArray;
Expected Output: [1,2,3]

Describe: currentTotal();
Test 1: Should add number in the array
Code:
playerOne.rollArray[1,2,3]; PlayerOne.currentTotal();
Expected Output: 6

Describe: totalRoll();
Test 1: Should add currentTotal to the totalRoll
Code: playerOne.rollArray[1,2,3]; PlayerOne.currentTotal();

6 playerOne.rollArray[1,2,3]; PlayerOne.totalRoll();
Expected Output: 12

License

MIT

Copyright (c) 2022 Timothy Empey & Ted Gold

About

Epicodus week 2 (2 day project)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published