Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //do
- do //אם מתקיימת רמאות, הלולאה תימשך
- {
- Console.WriteLine("Select row, then press 'enter' (return), then select column."); //הסבר על בחירת מיקום
- int row = int.Parse(Console.ReadLine()); //משתמש בוחר מיקום
- int column = int.Parse(Console.ReadLine());
- if (row > 3 || row < 1 || column > 3 || column < 1) //בודק שהמספר בטווח
- Console.WriteLine("Invalid row/column! There are only 3 rows and 3 columns on the board!\nPlease choose again.\n");
- else if (board[column - 1, row - 1] == 'X' || board[column - 1, row - 1] == 'O') //בודק רמאות
- Console.WriteLine("You cannot overwrite you/your friend! Please choose again.");
- else //מתקיים אם הבחירה תקינה
- {
- board[column - 1, row - 1] = userType;
- cheating = false;
- }
- }
- while (cheating);
- //while
- while (cheating) //לולאה שמתקיימת אם נמצאת רמאות
- {
- Console.WriteLine("Select row, then press 'enter' (return), then select column."); //הסבר על בחירת מיקום
- int row = int.Parse(Console.ReadLine()); //משתמש בוחר מיקום
- int column = int.Parse(Console.ReadLine());
- if (row > 3 || row < 1 || column > 3 || column < 1) //בודק שהמספר בטווח
- Console.WriteLine("Invalid row/column! There are only 3 rows and 3 columns on the board!\nPlease choose again.\n");
- else if (board[column - 1, row - 1] == 'X' || board[column - 1, row - 1] =='O') //בודק רמאות
- Console.WriteLine("You cannot overwrite you/your friend! Please choose again.");
- else //מתקיים אם הבחירה תקינה
- {
- board[column - 1, row - 1] = userType;
- cheating = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement