I wasn’t sure what was the best way to handle the matrix, how to keep track of what has been revealed and I ended up making two versions. In the first I made the matrix an object and had two of them one containing what is behind the squares and one with what has been revealed. The hardest part was making the function for when a square that has no bombs to it, it needs to reveal each square around itself and repeat if it reveals the same kind of square.
After making a working version I realized I could have made each square an object and use a list of them. So I made a second version with that approach and I like that a lot better. I also made a way better function to handle the empty squares which calls itself if it reveals another empty square.
I’d love some feedback if there are things I could improve.
CodecademyCS101/CS101 at main · Orri99/CodecademyCS101 · GitHub