Minesweeper game built to practice the MVC pattern.
This game was so much fun to implement. I believe this game is one of the best ways to actually learn how to write clean code.
I realized that I can also make my data models observable and then my view will subscribe to any model changes, which helped me understand React more.
I kept it simple this time, I didn't implement observable pattern I just let the controller handle everything:
- View delegates the user action to the controller
- Controller tells the model classes to update
- Model classes update and return what got updated to the controller
- Controller tells the view to update what needs to be updated
Without this pattern things can get messy really quickly.