When Random is too random!

Just wanted to share my changes after randomising the next number guessed. As a hobbyist programmer in javascript I’m familiar with issues in random ranges and when testing the extremes I’d get repeating numbers, and inabillity to guess to 1 (it would just keep looping the number 2)

comments in the code. Loving the course so far!

https://gist.github.com/johnnyweb1/ea287ba33ca53d36444cb5c288d7247d

1 Like

Great! Is a good option,
I had the same problem when the difference between the maximum and the minimum were too small

Privacy & Terms