DEV Community

LindaMolsson
LindaMolsson

Posted on

Minesweeper with CustomTkinter

This game was built as my final project on codecademy's cs101. The assignment was to build a game and I chose the classical “minesweeper”.


The game is built with the CustomerThinker module and consists of a class called "Cell" that uses a for loop to create a grid that is displayed to the user as buttons. The size of the grid depends on the user's choice of "small" (5x8 with 9 minis), "medium" (10 x12 with 15 minis) or "large" (15x16 with 20 minis). The "min" attribute is assigned to the cells using the "random module". Each cell must display the amount of mines surrounding them, this is done with a function called "count_mines" which is called when the "cell button" is left clicked

GitHub link

Top comments (0)