ukrebel
Active Member
- Joined
- Nov 6, 2005
- Sythe Gold
- 15
- Messages
- 196
do
{
Console.WriteLine("Please enter an X co-ordinate ( Between 0 - 8)");
X = int.TryParse(Console.ReadLine());
}
while (X <0 || X >8) ;
I am just wondering, if anyone would be able to help me to get it to catch if a person enters a wrong value (such as t or &), for it either to then let it carry on through the loop but set the X to -1 so the while loop catches it. or loops me back to the beginning on the do loop
Any help would be much appreciated!
I'm creating MineSweeper if anyone is interested
{
Console.WriteLine("Please enter an X co-ordinate ( Between 0 - 8)");
X = int.TryParse(Console.ReadLine());
}
while (X <0 || X >8) ;
I am just wondering, if anyone would be able to help me to get it to catch if a person enters a wrong value (such as t or &), for it either to then let it carry on through the loop but set the X to -1 so the while loop catches it. or loops me back to the beginning on the do loop
Any help would be much appreciated!
I'm creating MineSweeper if anyone is interested







