+ 1
I have two integers with randomized value. After player input, they get reset. Why? C#
I'm making a math quiz that generates two random numbers between 1-10, then you try to find the hypotenuse, and enter that as player input. But as soon as you hit enter, the two random numbers get randomised once more, and the answer changes with it. So even if you write the correct answer, the answer will change and tell you it's wrong. Here's the code: https://dotnetfiddle.net/Em6h74
18 Respostas
0
Wait Lemme check..
0
See my this code... and it works fine
.. maybe the problem is in dotnetfiddle and just remove that while loop
https://code.sololearn.com/cQ0fosUVLD31/?ref=app
0
the problem with this (and the reason I didn't use code playground) is that it asks for player input before displaying a and b, so it would be impossible to answer correctly
0
But you can try by... Removing the random and placing any value in place of random
0
nah, that would ruin the point... it should give random math questions. It's sooo close to being right and nobody knows what the problem is caused by
0
So kindly wait till tomorrow, I check it on my pc. Can't do that today because I am going to sleep
0
Sorry Elin.
0
hey, no problem. Thank you for helping anyways :p
0
By the way where do you live and which languages do you know?
0
Sweden, and I'm not sure if you're talking about real languages or coding, the only code language I know a bit of is C#
0
Your age?
0
15, turning 16 in two months
0
Talk to you tomorrow, gonna sleep
0
alright. good night!
0
Thanks
0
I am too 15, India
0
All new programming contest started today, hurry up. #CodeItOff
For more info: https://www.sololearn.com/Discuss/507479/?ref=app
0
All new programming competition is open to take new entries, submit you code now!
#CodeItOff
https://www.sololearn.com/Discuss/507479/?ref=app