Minesweeper adjacent mines with one dimensional array?
So I've searched around the internet for a way to check for adjacent mines. And a lot of algorithms for it do exist out there. The thing is
that all of the solutions that I've encountered for the algorithm is using a two dimensional array while I want to use a one dimensional array.
I will create my array and initialize 10 mines at random positions. Then I want to count the mines around these squares that are initialized to 0.
So the solutions out there for two dimensional arrays work, but how would I go with a one dimensional array?
Also consider that I don't take in x and y coordinates in the function that creates the board.
So I would need some tips or refering for who to do this.
Thanks in advance!
Research links:
Simple Minesweeper [C] -- Kinda eh..
Implementation of Minesweeper Game - GeeksforGeeks