Today we're going to work on a game that you can play with your friends. The way the game works is each player is assigned a key on the keyboard (max 2 players). A timer will start with 30 seconds on the clock. During that 30 seconds each player is to hit their key as many times as possible. After the time is up the program will print out the key presses for each button and who won. For a bonus play with a co-worker or friend and see who wins. Enjoy!
Comments:
bumbleguppy - 10 years, 4 months ago
javascript
reply permalink
bumbleguppy - 10 years, 4 months ago
I guess I should have added a "while(player1key == player2key){ player2key = prompt('Enter a different key, jackass...')}" after the first prompt for second player :)
reply permalink