1/2/2024 0 Comments Simple minesweeper![]() ![]() So, you have one of the most popular games globally, but do you know how to play it? The game wasn’t released with any tutorial when you start it. Interestingly enough, the point of the game was for the users to learn to use the right-click. The game was first introduced as a part of the Windows operating system in 1992 with Windows 3.1. Developed by Robert Donner, the game was something like a pet project for him that initially got distributed within Microsoft for his colleagues to play it. The Minesweeper, as we know today, was born by the end of the 80s. The general idea behind Minesweeper is a series of games that first started to appear around the 60s, and it became popular around the 80s. Mostly popular as the little bomb finding game included in every Windows installation, this game has roots dating back way before that era. However, having the grid means if you need to use it for other things later on, you have it around and don't need to recompute it every time.Puzzle games have been around for a while, and while some have advanced quite a lot over the years, some kept things simple. This way, you don't need to have the counter grid and don't need to increment it each time. HiddenGrid = "\033\033Ī different way you could do it is just add this block to the very end after the bomb skip check: count = 0 Next, each time you add a bomb, increment the counter for each grid space that touches it: for a in range(y - 1, y + 2): So, at the top of your function, you could first create a number grid: grid = for x in range(gSize)]. However, to answer your question directly, what I would recommend doing is each time you place down a bomb, you increment a counter for every cell adjacent to it. I would personally recomment storing the bomb array as a numerical array and having a way to process it into the output afterwards. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |