Liutauras Vilda wrote:
Erwan Jumel wrote:Yes I understand what you mean, with a good understanding of the game it's easier to program, but from what I understand, the method must return true if the adjacent square is revealed and if it has no adjacent mine (the mine is the "-1" so the bomb!).
Well, it isn't very clear what kind of functionality you'd be trying to satisfy with such method.
So we have this, what you wrote earlier:
Erwan Jumel wrote:...we have a function that must return a boolean, it must return true if one of the squares adjacent to the coordinate box (i,j) is revealed and has no adjacent mine
Do you have some class which holds information whether it was revealed or not? Do you have some method which tells how many bombs you have in adjacent tiles? Without having that information, obviously you couldn't return true or false, simply because you couldn't make a decision without such information.
You mentioned it is a group project, so I still don't fully understand what is your task. Just that one method to implement? If that's the case, you need to wait until somebody else done their job. Or you need to implement full game?
Paul Clapham wrote:
Erwan Jumel wrote:from what I understand, the method must return true if the adjacent square is revealed and if it has no adjacent mine (the mine is the "-1" so the bomb!).
Not "the" adjacent square -- there's always more than one adjacent square. But other than that, do you have another question to ask?
Liutauras Vilda wrote:
ewen lmj wrote:The for (7,1) the function will return "true" , because it has an adjacent cell revealed and has no adjacent mine.
Could be, but what's then?
ewen lmj wrote:I had thought of making a "revealed" function
Word function on its own suggest, that it does somehting. For example, sums something, in which case Sum would be a good function name, draws something, in which case Draw would be a great function name.
And now you suggest Revealed (something what seems happened already in the past). What that supposed to mean/do? Maybe Reveal would be something what would make more sense... Anyway, that seem to be too early.
I suggest you stop thinking about particular function(s) and what they'd return.
Think about the game first. Do you understand the mechanics behind the game? For instance.. Simplest case is probably you guessed correctly, open (or reveal as discussed) the tile, and it is a bomb - game is over. Clear outcome? I'd think so.
Now, you click on the tile, and it isn't a bomb. How many kind of different conceptual scenarios could be in such case?
I guess what I'm trying to say - write down the game first, so you and everybody else understands what's happening behind the hood. Or algorithm so to speak. Once you understand actually how the game works - then would be much easier to start. Somewhere.