meilleurs coms ig
This commit is contained in:
@@ -18,7 +18,7 @@ std::vector<Polyomino> Generator::generatePolyominos(int polyominoSize) {
|
||||
// a polyomino has at least 1 square
|
||||
if (polyominoSize < 1) return this->validPolyominos;
|
||||
|
||||
// start generating from the monomino
|
||||
// always place the first cell at (0, 0)
|
||||
this->currentTestedShape.insert(Position{0, 0});
|
||||
|
||||
std::map<Position, int> candidatePositions;
|
||||
@@ -57,7 +57,7 @@ void Generator::generate(int polyominoSize, int lastAddedPositionNumber, int nex
|
||||
this->tryToAddCandidatePosition(Position{position.x - 1, position.y}, nextAvaibleNumber, candidatePositions);
|
||||
}
|
||||
|
||||
// generate polyominos for all positions with a higher number than the last one
|
||||
// try adding a square only to positions with a higher number than the last one
|
||||
for (auto [key, val] : candidatePositions) {
|
||||
if (val > lastAddedPositionNumber) {
|
||||
this->currentTestedShape.insert(key);
|
||||
|
||||
Reference in New Issue
Block a user