cd ~/Desktop/class-folder
npm install
.npm install -g grunt-cli
.grunt
into your terminal.Students will write a method to update the game board continuously.
Students will write logic to select a random element from an array.
Students will write logic to validate and record a guess.
Students will write logic to determine if the game is in a winning, losing, or playing state.
Students will improve the logic for determining the state of the game by refactoring one method into discreet methods with a single responsibility that provide the same functionality with more flexibility.
Students will prompt the user for a guess and register it with the game.
Students will draw a hangman in the browser representing the current state of the game.
Math.random()
to generate a random number (00)floor
method of theMath
Objectto round a number (01)++
shorthand to increment a value (03)toLowerCase
method on String (02)indexOf
method on a String (02)length
on an array (01)push
function (03)slice
to create a new array by selecting a portion of another array (06)join
to build a string from an array (06)for
loop (03)getElementById
function (00)innerHTML
function (00)alert
to deliver information to the user in the browser (05)prompt
to receive user input in the browser (05)