Hi all. Let me know if there’s any way to reduce my code. I implemented picking a number range. Q picks 1 to 100, E picks 1 to 1000, etc. There is a guess counter. It specifies between “Iv’e guessed 1 time.” and “I’ve guessed to times.” (the ‘s’ gets added to ‘time’ after the first guess). I also have the computer picking a random number within the current range. I’m gonna post my code, but try to use your own logic to set things up. The only thing the lesson didn’t teach us is Random.Range(1stNumber , 2ndNumber). I think it just calls a random number between 1stNumber and 2ndNumber, then sets the new min/max. I’m not quite sure what bool does yet. The coding is attached. Lemme know what you think?
This would save you from using the if-else code above with the same desired result.
Also, you are right about the Random.Range(min,max) keyword. It specifies the range from min to max and chooses a random number from that range.
Bool only has two conditions (true and false or 1/0), so it works just like a switch. For example, (in your code) it was used like a switch to detect whether the range was chosen by the end user.