Guess | Sololearn: Learn to code for FREE!

-1

Guess

How do I restrict the number of guesses user has to guess a word in JavaScript

4/22/2018 3:59:31 PM

love

2 Answers

New Answer

+3

I would advise the same logic as Adam did (though I reversed it to track remaining instead of the current guess number). See the code: https://code.sololearn.com/Wh3jmbi3r1mb

+1

set up a counter. and every time they guess increment it by 1. check if counter < limit.