import java.util.Scanner;
/**
* Created by Константин on 13.09.2014.
*/
public class Primer {
public static void main() {
static void exercises7 () {
char[] charArray = new char[9];
for (int i = 0; i < charArray.length; i++) {
charArray[i] = '_';
}
for (int i = 0; i < charArray.length; i++) {
if (i % 3 != 2) {
System.out.print(charArray[i] + "");
} else {
System.out.println(charArray[i] + "\n");
}
}
Scanner scanner = null;
while (true) {
System.out.println("Введите координаты ячейки. Для выхода введите 0");
scanner = new scanner(System.in);
int numbRow = scanner.nextInt();
if (numbRow == 0) {
System.out.println("GAME OVER");
scanner.close();
return;
}
int numbCol = scanner.nextInt();
scanner = null;
scanner = new Scanner(System.in);
System.out.println("Введите символ");
char symbol = scanner.nextLine().charAt();
int index = numbCol + (numbRow - 1) * 3 - 1;
System.out.println(
"NumberRow = " + numbRow + ",NumberColumn =" +
numbCol + ",i =" + index);
charArray[index] = symbol;
for (int i = 0; i < charArray.length; i++) {
if (i % 3 != 2) {
System.out.print(charArray[i] + " ");
} else {
System.out.print(charArray[i] + "\n");
}
}
}
}
}