- JavaScript
- JQuery
- HTML
- CSS
- Boostrap
- Markdown
- Git/hub
See Brainstorm below
Link to lesson: https://www.learnhowtoprogram.com/intermediate-javascript/object-oriented-javascript/game-of-choice-two-day-project
Test: "It should create player" Code: Expected Output: player1 = {score, lastroll
Test: "It should return random number between 1-6 when button is submitted" Code: rollDice(); Expected Output: player1 = random number between 1-6
Test: "It should add currentScore to RoundScore to find TotalScore. If currentScore is 1 is should 0 out RoundScore and not add anything to the totalScore." Code: this.roundScore; Expected Output: {currentScore, roundScore, totalScore}
- Clone this repository to your desktop
- Navigate to the top level of the directory
- Open index.html in your browser
- Current score can still be 0.
MIT
Copyright (c) 2022 Manuel Raygoza Donovan Weber Ashe Urban
Easy: Computer always stops after second roll. Hard: Computer uses strategy based on current total and rolled dice.
human player vs human player
let player1TotalScore = 0; let player2TotalScore = 0;
create a new game (like addressBook) create a object for players create player objects name: totalScore:
create function that creates a random number between 1 and 6 (math.random(1,7)) if number !=== 1, add value to currentScore if number === 1, currentScore ===0; turn over; switch player return internalTurnScore + player[?]TotalScore
create a "hold" function to add currentScore to player's totalScore reset internalTurnScore to 0 switch player
create function to check if player's score >=100 check if player's score >=100 => WINNER else keep playing