minesweeper

Recursion error in GUI

拈花ヽ惹草 提交于 2019-12-02 09:09:39
问题 I am creating a simple 9x9 grid for Minesweeper. One of the primary functions of this game is to have a recursion to check all the sides when the tile clicked has no bombs surrounding it. In the code attached below, I have been able to create a function that checks the upper and left side of the tile. If I add more directions, such as lower and right side, the program will crash and will not properly display the tiles. (Check the method countBorders under the line //MY MAIN PROBLEM ) /

Recursion error in GUI

吃可爱长大的小学妹 提交于 2019-12-02 08:08:05
I am creating a simple 9x9 grid for Minesweeper. One of the primary functions of this game is to have a recursion to check all the sides when the tile clicked has no bombs surrounding it. In the code attached below, I have been able to create a function that checks the upper and left side of the tile. If I add more directions, such as lower and right side, the program will crash and will not properly display the tiles. (Check the method countBorders under the line //MY MAIN PROBLEM ) //displays the main GUI package Minesweeper4; public class mainFrame { public static void main(String[] args) {

Minesweeper solving algorithm [closed]

筅森魡賤 提交于 2019-11-28 16:15:13
I am pretty sure most of you know about the minesweeper game. I wanted to code (in C#) my own minesweeper game and was looking for some input as to what would be a good algorithm for that game. I have been browsing over the web for quite some time now but could not find a good solution. Can anyone help me with it? Generating the grid is simple. There are a couple simple algorithms that you need when executing the player's move, to determine which squares to open up and whether they have lost or won. Generating the grid The simplest algorithm is to place all of the mines randomly. (Make sure

Minesweeper solving algorithm [closed]

杀马特。学长 韩版系。学妹 提交于 2019-11-27 19:55:54
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I am pretty sure most of you know about the minesweeper game. I wanted to code (in C#) my own minesweeper game and was looking for some input as to what would be a good algorithm for that game. I have been browsing over the web for quite some time now but could not find a good

Program is generating same random numbers on each run? [duplicate]

拥有回忆 提交于 2019-11-27 05:12:56
This question already has an answer here: Why does rand() yield the same sequence of numbers on every run? 6 answers I just finished coding a Minesweeper type game, and everything's good except for that each time I run the application, it generates the same number (I ran it 3 different times, saved the output to 3 text files and used the diff command in Linux, it didn't find any differences). It's seeded by time(NULL) so it should change every time, right? Here's my code: main.cpp #include <iostream> #include <cstdlib> #include <time.h> #include <string> #include "Minesweeper/box.h" #include

How can I identify buttons, created in a loop?

不羁岁月 提交于 2019-11-26 21:45:31
问题 I am trying to program a minesweeper game on python using tkinter. I started off by creating a grid of buttons using a two dimensional list of 10x10. Then I created each button using a loop just so I don't have to manually create every single button and clip them on. self.b=[[0 for x in range(1,12)] for y in range(1,12)] #The 2 dimensional list for self.i in range(1,11): for self.j in range(1,11): self.b[self.i][self.j]=tkinter.Button(root,text = (" "),command = lambda: self.delete()) #