|
-
January 18th, 2011, 08:35 AM
#1
Problems with IF sectence
int diceRoll1 = RollDice(min, max);
System.Threading.Thread.Sleep(5);
MessageBox.Show("The number rolled was: " + diceRoll1 + ".");
public int RollDice(int min, int max)
{
Random random = new Random();
return random.Next(1, 7);
}
Want to make a IF sectence which does this:
When i roll i get a value, i want this value to decide what picturebox is going to be set as true. So lets say i have stacked 6 pics on each other. If the return value is 1, i want picture number 1 to be set as true, and the other to be set as false. Which means pic number 1 is the only one to show.
So basically i want the IF sectence to work like this :
If return value is 1 - set 1 true
But the problem is the IF sectence, i don't know how to write the correct code to achieve this.
I've tried many variations of wrong IF sectences to try to manage this. Help!
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|