Mine Picker

Recommended levellevel
5+
About 10 years ago, an omen appeared in offices everywhere: if an employee is staring too intently at his screen and occasionally clicks with the mouse with the same intensity, he's most likely playing Minesweeper. For anyone who has forgotten, and for others who missed this era due to their age: Minesweeper is one of the most popular office games that shipped with Microsoft Windows. Even today, if you're sitting at a computer running this operating system, Minesweeper is either pre-installed (just type "Minesweeper" in the Windows search box) or you can download it free from the Microsoft Store. Many Linux builds, such as KDE and GNOME, also acquired similar games. Unlike most other "time killers", this game presents the perfect balances of logical moves and random moves, making Minesweeper very exciting and simultaneously... somewhat less pointless than other such games. So, we have a game board divided into squares. Some of them contain "mines", but we don't know how many there are or where they are. Our goal is to reveal all of the unmined squares without getting blown up. You reveal a square with a left click. If it doesn't contain a mine, then a number appears that represents the number of mines adjacent to the revealed space. Now you need to do some thinking and guess which cells can be revealed and which should be marked as mined. And so it continues until you win or explode. Windows developers created this toy to help humans learn to use the mouse (yes, there was a time when computers didn't have mice and you had to be content with just the keyboard). Actually, the history of Minesweeper stretches farther back than even Microsoft. Its predecessors were available on mainframes as early as the sixties of the last century? But we digress... Right now, we're talking about creating our own version of Minesweeper! The rules for our "probabilistic brainteaser" will be exactly those described above. We've already divided this difficult task into subtasks on CodeGym and we'll tell you what to do. Be brave.
Comments (685)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
yesterday, 14:07
что-то у меня глюки или в какой версии Java живут компилятор и валидатор???. в 6 задаче, не прошел тип var... поменял на List<GameObject> - все ок
Мария Чернышова Full Stack Developer
24 August, 13:23
Никакого описания метода с диалогом не предоставлено, только набор параметров. Что за что отвечает? Почему два цвета передаются и что за int? Что передавать не ясно. Если нет описания, наугад херачить?
Bilal Zankiev
Level 19
27 August, 18:44
там все придоставили, ты о чем?
Nicko
Level 28
10 August, 12:27
Валидатор, ты душнила!
23 July, 07:17
Добрый день всем, я увидел этот раздел и мне сразу же стало очень интересно его потыкать, но тут я столкнулся совсеееем с неизвестными мне задачами по типу объявления классов и переопределения, я прошёл 6 уровней и тут показано 5+. я ещё не дошёл до нужных статей или же чтобы это решать надо отдельно что-то смотреть. буду благодарен за ответ
Serge Menko Java Developer
30 July, 21:09
не обращай внимания на уровень, он не соответствует уровню на курсе, я раньше 18 уровня не советовал даже бы не заглядывать в этот раздел если ты совсем новичек.
madmax дизайнер из Санкт-Петербу
18 July, 14:59
Добрый день. Подскажите пожалуйста движок в виде jar файла можно где нибудь взять?
Serge Menko Java Developer
30 July, 21:11
в папке lib должен быть он там лежит как библиотека.
madmax дизайнер из Санкт-Петербу
31 July, 11:52
у меня нет плагина для идеи
13 July, 10:17
private void createNewNumber(){ int x = getRandomNumber(SIDE); int y = getRandomNumber(SIDE); if (gameField[x][y] == 0){ gameField[x][y] = getRandomNumber(10) < 9 ? 2 : 4; } else { createGame(); } В чём проблема такой реализации метода
13 July, 08:53
c валидатором проблемы,5 раз не пропускал, только из за лишней пустой строки перед последней скобкой
Lismu
Level 2
16 June, 06:30
private void createGame(){
        for (int x = 0; x < SIDE; x++){
            for (int y = 0; y < SIDE; y++){
                gameField[x][y] = new GameObject(x,y);
                setCellColor(gameField[x][y].x, gameField[x][y].y, Color.YELLOW);
            }
        }
    }
Не пойму, почему не проходит проверку в этом пункте 4-го шага - "В методе createGame() нужно заполнить все ячейки массива gameField новыми объектами типа GameObject с соответствующими координатами x и y."
7 July, 16:08
В поле gameField наоборот x - ширина и y - высота, попробуйте gameField[y][x].
madmax дизайнер из Санкт-Петербу
14 July, 15:19
как вы до этого дошли? это же абсолютно не очевидно, и я не уверен, что это логично тоже не проходила валидация и ваш коммент мне помог
15 July, 19:37
У меня была такая же ошибка :) помогли другие комментарии, а потом увидела что в одной из игр в условии написали что в движке координаты x и y не так как мы привыкли.
7 June, 10:51
Супер
27 May, 06:55
Super