Hi , Im designing a game on visual C# the game must contain two text boxes and two bottons and a lable
in the first text bos I should enter the range of numbers the program should randomly generate. ---- and its activated by the botton.
the second text box is the place where i enter the guesses ,---- also there is a botton to read the number.
I will have a limit of ten guesses , each is assgined a color.
for example the game will start with the green and if my guess was wronge the color wil change to a darker color ( dark green ,darker ..... red etc) and if I guessed the right answer the screen will get back to the green with a lable that say you won !! or if I finished my guesse it show me Game Over !!
Now Im not that xpert in Visual C# so I find it hard where to write the code ... and how to activate actions as the color changing thing
BUT i understand that i need to use the random function and know how to set the range as you will see in the code below but Now Im stuck I don't know how to continue,,, Some one please guide me and help me.
private void button1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
int range;
range = int.Parse(textBox1.Text);
System.Random RandNum = new System.Random();
int Magicnumber = RandNum.Next(0, range);
int numberofguesses = 0;
}
private void button2_Click(object sender, EventArgs e)
{
int usersguess ;
usersguess = int.Parse(textBox2.Text);
if (usersguess == Magicnumber) ;
{
// I dont know what to write here
}
{
if (usersguess != Magicnumber);
{
// I dont know what to write here
}
}
}
}
}
I know this stupid but Im not pro and I would like to learn from you guys and I belive this is the right place to ask ....
thanx in advance