Tick Tack Toe

Recommended levellevel
5+
Tic-tac-toe [1] is a logical game between two opponents on a square field of 3 by 3 cells or larger (up to an “endless field”). One of the players plays with "crosses", the second - with "toes". The traditional Chinese game Gomoku uses black and white stones. Players take turns placing signs on the free cells of the 3x3 field (one is always crosses, the other is always zeros). The first one to line up 3 of his pieces vertically, horizontally or large diagonally wins. If the players have filled in all 9 cells and it turns out that there are no three identical symbols in any vertical, horizontal or large diagonal, the game is considered to be a draw. The first move is made by the player placing crosses. Usually, at the end of the game, the winning side crosses out its three signs (a zero or a cross), which make up a continuous row. Exchange icons It is possible to override the rule that tells players to only place their own type of icon. For example, a game option could be: players put a cross or a zero (whatever they want); the first one wins if he builds a line of the required length from identical icons, the second one wins if this does not happen before filling the field. Another option: “your” icon changes with each move. Super tic-tac-toe The game consists of nine tic-tac-toe boards arranged in a 3×3 grid. Players take turns playing on the smaller tic-tac-toe boards until one of them wins on the larger tic-tac-toe board. Compared to traditional tic-tac-toe, the strategy in this game is conceptually more complex and has proven to be more challenging for computers.
Комментарии (58)
  • популярные
  • новые
  • старые
Для того, чтобы оставить комментарий Вы должны sign in
Никита
Уровень 79
2 July 2025, 16:46
Как открыть задачу в idea? Сам файл есть. Задачу плагин не показывает:
Gans Electro
Уровень 4
3 July 2025, 07:06
Эти задачи всегда такими были, думаю только WEB
Никита
Уровень 79
3 July 2025, 11:56
Да нет, я раньше мог в idea открыть (была папка games), сейчас не могу
Evgenii
Уровень 1
24 June 2025, 10:20
public boolean checkWin(int x, int y, int n) { if (model[x][0] == n && model[x][1] == n && model[x][2] == n) return true; if (model[0][y] == n && model[0][y] == n && model[0][y] == n) return true; return false; } Не проходит проверку : Метод checkWin(x, y, n) должен возвращать false если нет ни одной вертикали или горизонтали заполненной n. Что делать? Сделал как в видео.
Gans Electro
Уровень 4
25 June 2025, 05:57
public boolean checkWin(int x, int y, int n) {
    if (model[x][0] == n && model[x][1] == n && model[x][2] == n)
        return true;
    if (model[0][y] == n && model[1][y] == n && model[2][y] == n)
        return true;
    if (model[0][0] == n && model[1][1] == n && model[2][2] == n)
        return true;
    if (model[0][2] == n && model[1][1] == n && model[2][0] == n)
        return true;
    return false;
}
Дмитрий Шалаев
Уровень 43
Expert
17 June 2025, 19:54
Здравствуйте! Подскажите, пожалуйста, как исправить проблему с отображением условия в Web IDE? (см. скрин)
16 February 2025, 22:29
Подскажите, как вернуться с 9 на 8 задание. Нажал кнопку "Проверка", надеясь увидеть картинку с результатом второй раз, но мне был засчитан недоделанный код как сделанный, и перешло на 9 задание. Кнопку "Правильное решение" я НЕ нажимал,и других кнопок не нажимал тоже.
Gans Electro
Уровень 4
19 February 2025, 09:59
Никак. Все нужно сбрасывать. Но по идее можно просто на следующий уровень отправить правильный скрипт
Александр
Уровень 47
20 January 2025, 08:33
А вот этот код не решает задачу? Проверку не проходит, не пойму почему public void updateCellView(int x, int y, int value){ String text = ""; switch (value){ case 0 : text = " "; case 1 : text = "X"; case 2 : text = "O"; } setCellValue(x, y, text); }
Gans Electro
Уровень 4
21 January 2025, 10:07
Подозреваю что дело в Default части
Igor
Уровень 38
21 January 2025, 15:37
Не хватает break в каждом case
Gans Electro
Уровень 4
22 January 2025, 16:55
Такой код работает до 7 уровня
public void updateCellView(int x, int y, int value) {
    String val;
    switch (value) {
        case 1:
            val = "X";
            break;
        case 2:
            val = "O";
            break;
        default:
            val = " ";
    }

    setCellValue(x, y, val);
}
Но там просят переписать, возможно if обязателен
11 August 2025, 12:47
public void updateCellView(int x, int y, int value) { String text = " "; Color color = Color.WHITE; switch (value) { case 0: break; case 1: text = "X"; color = Color.RED; break; case 2: text = "O"; color = Color.BLUE; break; } setCellValueEx(x, y, Color.WHITE, text, color); } вот так вполне себе проходит)
Daniil Medvediev
Уровень 44
12 January 2025, 16:21
Хочу делать игру в интеллидж отдельно от курса, а надо импортировать класс гейм import com.javarush.engine.cell.*;. И выдает ошибку подчеркивая джавараш. Может есть другой импорт?
Mukhan GazirsharifDWH Developer at BCC bank
15 January 2025, 13:06
Скачай как библиотеку. В низу кажется есть раздел Dependencies в Intellij IDEA
Ян Степуро
Уровень 1
1 December 2024, 18:31
находясь на 8 задаче, в поисках кнопки, которая вернет меня на прошлую задачу, нажал на проверку и 8ая задача зачлась сама по себе, хотя задание не выполнял
Никита
Уровень 16
Expert
4 December 2024, 13:29
Скорее всего вы изначально выбрали "правильное решение", а потом нажали проверка
Иван
Уровень 1
21 October 2024, 17:05
как мне вернуться на 8 подзадачу?
Tachikoma
Уровень 28
19 September 2024, 11:28
На 21 шаге нужно как бы виртуально походить в клетку, присвоив значения Проверить, победили мы при этом ходе или нет Затем отменить наши действия Передать значение наших потенциальных похождений в клеточку
Тата
Уровень 1
15 September 2024, 19:09