+ 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

2nd Jul 2017, 4:18 AM
Elin Granath
Elin Granath - avatar
18 Antworten
0
Wait Lemme check..
2nd Jul 2017, 4:51 PM
Bruh
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
2nd Jul 2017, 4:59 PM
Bruh
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
2nd Jul 2017, 5:01 PM
Elin Granath
Elin Granath - avatar
0
But you can try by... Removing the random and placing any value in place of random
2nd Jul 2017, 5:05 PM
Bruh
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
2nd Jul 2017, 5:07 PM
Elin Granath
Elin Granath - avatar
0
So kindly wait till tomorrow, I check it on my pc. Can't do that today because I am going to sleep
2nd Jul 2017, 5:10 PM
Bruh
0
Sorry Elin.
2nd Jul 2017, 5:10 PM
Bruh
0
hey, no problem. Thank you for helping anyways :p
2nd Jul 2017, 5:11 PM
Elin Granath
Elin Granath - avatar
0
By the way where do you live and which languages do you know?
2nd Jul 2017, 5:12 PM
Bruh
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#
2nd Jul 2017, 5:12 PM
Elin Granath
Elin Granath - avatar
0
Your age?
2nd Jul 2017, 5:13 PM
Bruh
0
15, turning 16 in two months
2nd Jul 2017, 5:14 PM
Elin Granath
Elin Granath - avatar
0
Talk to you tomorrow, gonna sleep
2nd Jul 2017, 5:21 PM
Bruh
0
alright. good night!
2nd Jul 2017, 5:21 PM
Elin Granath
Elin Granath - avatar
0
Thanks
2nd Jul 2017, 5:22 PM
Bruh
0
I am too 15, India
2nd Jul 2017, 5:22 PM
Bruh
0
All new programming contest started today, hurry up. #CodeItOff For more info: https://www.sololearn.com/Discuss/507479/?ref=app
3rd Jul 2017, 5:06 AM
Bruh
0
All new programming competition is open to take new entries, submit you code now! #CodeItOff https://www.sololearn.com/Discuss/507479/?ref=app
3rd Jul 2017, 1:10 PM
Bruh