問題タブ [minesweeper]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
1202 参照

python - Python で書かれた私のマインスイーパ プログラムがボード全体を明らかにしています - 再帰の問題

Python を使用してマインスイーパ プログラムを作成しようとしています。私のカスケード公開を除いて、すべてが正常に機能しています。ここに私が持っているものがあります:

ActualBoard は、すべてが公開されたリストのリストで構成されています。

地雷が 1 つある 4x4 ボードの場合。

GameBoard もリストのリストで構成されていますが、ゲームが開始されると次のようになります。

0 投票する
1 に答える
182 参照

java - マインスイーパ地雷が配置または表示されない

このコードを実行するとボタンがロードされないのはなぜですか? 質問は私が知っている非常に漠然としていますが、私はJavaに非常に慣れていないため、一度に多くのことを理解しようとしています. このコードは、TicTacToe と Connect Four のコード化に成功した以前の 2 回の試みに基づいており、どちらもうまくいきました。

0 投票する
1 に答える
85 参照

python - hiding a widget according to x, y coordinates

I'm quite a newbie when it comes to programming, and in our programming excercise in school I'm making a minesweeper game in python using TKinter as GUI. The game works, except my "floodfill" algorithm, to clear any adjacent blank spaces. I have made the board, printed a previously created list, according to choices(height, width and amount of mines) chosen by the user, with labels, and hidden these labels behind buttons.

I can bind events to hide these buttons when clicked on, but what I also want is to be able to hide the buttons nearby, with the help of my floodfill algorithm. I feel like all I need anymore is the line of code that will hide the button according to x and y coordinates, and not just the one that's clicked upon. I think you've got the idea,

the long line of # is where I believe is all I need anymore to get this system to work, in something like "button.position(x, y). I attempted to save the button in the blist, and maybe I could get the correct button that needs to be hidden from it, with the help of x and y coordinates?

of course, if you have a better idea how to solve this problem, I'd love to hear it.

0 投票する
1 に答える
203 参照

algorithm - マインスイーパ専用ケース

課題のためにマインスイーパを作成する必要がありますが、この特定のケースに関する情報が見つかりません。

ここに画像の説明を入力

0 は空白、数字は数字、* は私のものです。上の 0 と右の 0 が互いに接触していないことを考慮すると、いずれかの 0 をクリックすると、斜めに隣接する 0 が表示されるはずですか? オンラインでゲームをプレイしているときは、このような状況には遭遇しませんでした。