Giter Club home page Giter Club logo

pig-dice's Introduction

Rolls dice if not 1 then keep playing or press stop function - dice function - switching turns

  • (player1, player2) current points
  • (player1, player2) total points = total + sum of current points

dice constructor = current roll scoreboard constructor = total , current score

currentPoint = 0;

Math.floor((Math.random()*6) +1);

Descibe diceRoll() Test: It will return a value of 1-6 Code: diceRoll() { Math.floor((Math.random()*6) +1); } Expected Output: ("1-6") ~ completed

Test: It will add to currentScore if the roll is not 1 Code: playerOne.diceRoll() playerOne Expected Output: sum of currentScore ~ completed

Test: It will return currentScore = 0 if 1 is rolled code: playerOne.diceRoll(1) playerOne Expected Output: (0) ~ completed

Describe newTotal() Test: It will add currentScore to totalScore Code: playerone.newTotal() Expected Ouput: currentScore + totalScore ~completed

Test: When you add the currentScore to the totalScore the current goes back to 0 Code: playerOne.newTotal(); playerOne Expacted Output: playerOne.currentScore(0) ~completed

Describe checkWinner() Test: If current score or total score >= 100 then a winner is declared Code: playerOne.checkWinner() Expected Output: "You are the winner!" ~completed

Describe switchTurn(bool) Test: If number rolled equals 1 then returns false and turn is switched Code: playerOne.switchTurn() Expected Output: false and switch the players turn ~completed

pig-dice's People

Contributors

chase-stokes 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.