• Log in or sign up for an account here: https://www.sythe.org/login

Noob C# programmer needing help

ryanb415

Member

Banned
Joined
Aug 9, 2012
Sythe Gold
1
Messages
27
I am currently working on a program that is Event based. (it's a form application)
it is a number guessing game, I'm having no issue creating the random variable, however, Every time I click the button the number changes, I am wondering if there is a way to store the first number that the random number creates. Any help would be greatly appreciated
 
PHP Shit Show 2k26
Just above the code that changes the number, store the variable if it's the first as an Integer, alternatively you could store them in an array.
 
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
int firstnumber;
int isFirstClick = true;
int randomnumber;

private button click event blah blah(){

if (isfirstclick == true)
{
isfirstclick = false;
firstnumber = genRandom();
return;
}

randomnumber = genRandom();

}


Something like that
 
Runescape Gamblingrunescape gambling
Back
Top