私は掃海艇の試合をしようとしていましたが、爆弾に隣接するセルが見つかるまで、隣接するセルを再帰的に表示します。私は座標xとyを与えれば、それを取り巻く鉱山の数を計算するという方法があります。 // Counts how many mines are adjacent to a given coordinate cell if any
void board::mineCount(int x, in
def floodfill(col,rowb,neigh,bombpos):
#neigh is number of bombs (neighbors) around the position (row,col)
try:
neigh[rowb][col]
bombpos[rowb][col]
visit[rowb][col]
except IndexError