for (int n = 1; n < size;) {
// Choose randomly a wall
Vector wall = Algorithms.random(walls, random);
walls.remove(wall);
// Check if both endpoints already exist
Move dir = wall.getX() % 2 == 0 ? Move.North : Move.East;
Vector a = wall.add(dir), b = wall.sub(dir);
boolean ac = tiles.contains(a), bc = tiles.contains(b);
if (ac && bc && random.nextFloat() >= redundantProbability)
continue;
// Add tiles to maze