Minesweeper (Part 4/16)

• 3
• Locked
We need to store the state of the playing field's cells somewhere. To do this, create a matrix (two-dimensional array) with the dimensions of the playing field. Populate the matrix with GameObject objects using this formula: gameField[y][x] = new GameObject(x, y); Now let's display all the cells o
You can't complete this task, because you're not signed in.
Hoist
Level 21 , San Diego, United States
4 March, 04:53
Works. Look at both files carefully >> https://codegym.cc/help/4690 Suggest you read thru many postings in the HELP section to step thru each line. It's closer to real life programming with Minesweeper checking many many files interacting.
Olivier Boudigue
Level 18 , France, France
27 December 2022, 22:59
Hi, why gameField[y][x] = new GameObject(x, y); nd no gameField[x][y] = new GameObject(x, y); ??? Thank
bella
Level 0
7 December 2022, 04:11

Elektra
Level 15 , United States of America, United States
29 January 2022, 14:46
gameField[y][x] = new GameObject(x, y); I do not understand the logic of switching the x & y in the first part. I thought it was a typo. Can someone explain it to me please?
Roman
Level 41
9 February 2022, 07:36
You may have noticed that the matrix coordinates are different from the classical rectangular coordinate system (Cartesian coordinate system). When you access the matrix, you first specify the y coordinate and then the x coordinate. In mathematics, it is customary to specify the x coordinate first, i.e. (x, y). https://codegym.cc/groups/posts/140-games-section-on-codegym-useful-theory
Sneaky One
Level 5 , Germany, Germany
6 October 2021, 08:52
A couple of questions: 1. Does it make any difference wether I write the code this way gameField[x][y] = new GameObject(x, y); or this way gameField[y][x] = new GameObject(x, y); ??? It cracks me up that it's always x, y and then suddenly it is supposed to be y, x!? 2. I'm at the beginning of level 4 when it comes to the course. Today I took a look at the tasks and saw this Minesweeper task which is supposed to be level 0. At level 4 of the course we haven't even talked about arrays so far. So how does this all fit together? This Minsweeper task confronts me with arrays...how am I supposed to solve a level 0 task which obviously is not level 0! I am confused...
miguel
Level 12 , Corredor
10 April 2021, 20:47
I think this exercise is for a highest level... not for a begining level where I was learning to use System.out.println(); I don't understand... I hope to understand this code I later lessons... I had to download the solution...
Sulayman Mohamed
Level 3 , Manacor
29 March 2021, 02:11
i have this problem and I dont know why? com/codegym/games/minesweeper/part04/MinesweeperGame.java:18: error: cannot find symbol gameField[x][y] = new GameObject(x,y); ^ symbol: variable x location: class com.codegym.games.minesweeper.part04.MinesweeperGame
Roman
Level 41
29 March 2021, 05:48
Please post your question with the attached solution in the section Help.
Akriti Bagale
Level 0
17 May 2021, 11:45
it may be because you have not use the variable x and y in the for loop

26 March 2021, 03:10
import com.codegym.engine.cell.*; why i use idea ，no engine package？

26 March 2021, 03:20