I am attempting to code a basic version of minesweeper on MATLAB and I've got it working good so far. The next step for me is for when the player selects a point on the game board that has no bomb and no bombs around it, it should display all of those empty squares around it. My thoughts are, to make sense to the player, it should replace the square you selected and the neighboring sqaures (including those that dont directly touch it - up until it does neighbor a bomb) into NaN. For example:
I've got the code working to display the boxes with neighboring bombs (i.e. the boxes with numbers in them) but I cant figure out how to replace the empty squares until they reach the boxes neighboring bombs into NaNs.
In case it helps, here's the code that figures out the moves, how you win, and how you lose. The mines are randomly placed.
coords = input('type the coordinates in brackets: ');
disp('oops that is a mine')