In your 'check_for_nearby_mines()' function, you do some extra work to check the selected square for boundary conditions. There is a method that will allow you to have one algorithm to check for nearby mines, without taking special cases (edge conditions) into account. Create your game board with an extra two rows and columns 2. Mar 9, 2018 - Simple Console Based Minesweeper Game Unblocked. Cara upgrade software nokia n95 8gb update windows 10. Further please make sure that you play these game during your free period only. Make all squares around the edge of the game board 'invisible' and always to have 'no mines' The user will never see the outer layer of 'invisible' squares, and whenever a square is checked for surrounding mines, there will always be a full 8 squares available to be checked (hence, no boundary limitations exist, which means a single algorithm in your 'check for mines' function). Okay, I'm no longer checking for boundary conditions, so the 'findnearbymines()' function is MUCH cleaner. But, there's still some work to be done, because it's not flushing out all the spaces without mines near the space selected by the user. In other words, if a space is set to '0' meaning there's no nearby mines, it should check the spaces around it for nearby mines. ![]() If the user selects a space set with a '0' however, sometimes there are more spaces flushed out not containing mines, spaces which should have already been flushed. I'm still looking for a solution. But, here's the code, maybe someone has an idea.
0 Comments
Leave a Reply. |