![]() Having binged on at least once or twice in their lives. That ubiquitous single-player puzzle game that most of us will admit to Weeks ago, I discussed briefly how to use event callbacks to implementĪnd later used this as a base for creating a There are lots of ways to go about this, just don't rely on data that isn't complete yet.Lately I've been playing around with interactivity in matplotlib. T = RawTurtle(screen, shape='circle') # 'assets/mine.gif')įor index, numx in enumerate(numxvalues): ![]() One solution is to break up this loop into multiple loops, one that generates mines, one that calculates proximities, and one that labels mines: # import stuff The problem is your while mines < 15: loop is still generating mines when it's trying to also count mines and label mines. Newpos = xpos * 10 + num, ypos * 10 + numyvalues # generate numbers that indicate mines in a 3x3 area T = RawTurtle(scrn, shape='assets/mine.gif') ![]() I am using a combination of the turtle and tkinter modules.īelow is the (unfinished) code for the game, any help with my problem as well as any feedback on anything else in the code would be appreciated! # import stuff One solution I have tried is using the EraseTile function to erase the previous number on that tile and replacing it with a higher number, but I am unsure where I would apply this function if it is even needed at all. I am trying to generate the numbers around the mines that show how many are in a 3x3 area, and so far it has been successful except that the numbers are overlapping when generated instead of replacing each other. I am pretty new to Python, and I just need some help with a simple algorithm for a minesweeper game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |