I really cant understand why my code isnt working... can you guys notice what is the problems? Java said I should rename 'guess' | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

I really cant understand why my code isnt working... can you guys notice what is the problems? Java said I should rename 'guess'

https://code.sololearn.com/cbN2XOXf62RU/?ref=app

31st Mar 2017, 4:21 PM
양창현
양창현 - avatar
5 ответов
+ 15
You've declared the variable guess twice. I just fixed it and gave input 55 (cheated from your code) and your program called me genius!! 😎
31st Mar 2017, 4:25 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 6
When taking the input in "guess", remove the int. Datatype keywords are for *declaring*, NOT assigning. Since guess is alredy declared, you don't have to use the keyword again to assign a value to it.
31st Mar 2017, 4:26 PM
Wen Qin
Wen Qin - avatar
+ 3
wow @Wen Qin, @Shamima Yasmin!! thanks guys!!!! finally I got the right code!!! hahahaha thank you thank you https://code.sololearn.com/cbN2XOXf62RU/?ref=app
31st Mar 2017, 4:35 PM
양창현
양창현 - avatar
+ 2
wow thanks for your precious help!!!!!!!! but I wanna make it having a kind of loop that will make the guesser retry right away when they were wrong and you are genius!
31st Mar 2017, 4:29 PM
양창현
양창현 - avatar
+ 1
You need answer=>random!!!
11th Feb 2019, 5:43 AM
Coder
Coder - avatar