void (int i, int j) { assertBounds(i, j); isOpened[i][j] = true; int smartCoord = getPlainCoordinates(i, j); if (isOpened[i - 1][j]) unionGroups(smartCoord, smartCoord - N); if (isOpened[i + 1][j]) unionGroups(smartCoord, smartCoord + N); if (isOpened[i][j - 1]) unionGroups(smartCoord, smartCoord - 1); if (isOpened[i][j + 1]) unionGroups(smartCoord, smartCoord + 1); if (connectedToBottom(smartField.find(smartCoord)) && isFull(i, j)) { myPercolates = true; } }