Hi Siddharth,
Just looking at line 25 and 34…
When the game starts, min
= 0 and max
= 1000, so line 25 says;
guess = 1000/2 + 0 which equals 500 and then the 500/2 = 250.
In the case of line 34;
guess = 1000 + 1000 / 2 = 1000 (seems a bit odd to add the number to itself and then directly divide by 2? You’ll always get what you started with? Afterwards, you further divide 1000 by 2 resulting in 500. The player stated their number was above 500.
Unless I’ve misunderstood I think it needs a little tweak
On a related note, it is much better to copy/paste your code directly into the forum and then apply the code formatting characters both before and after it. Not only does this help enormously with readability, which can be challenging when the code is in an image, especially on mobile devices, it also enables those that offer to help you the ability to copy/paste parts of your code back in their reply to you with perhaps suggestions/corrections. Screenshots are however very useful for error messages or details from the Unity editor.
See also;
- Forum User Guides : How to apply code formatting within your post
sir i reached chapter 13 …next in chapter 14 i will follow …sir i am new to C# programing so please help me in my learning , thanking you
regards siddharth
Hello Siddharth,
Well done for giving it a go yourself, enjoy the rest of the course, any problems just post and someone will help you