Skip to content

Commit

Permalink
fix propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
clementlrd committed Aug 16, 2022
1 parent 41cceda commit 94ad8d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ The algorithm made the following images from these patterns :
- mountains tiles
- polka tiles
- roads tiles
- rail tiles

![generated circuit image](/doc/images/circuit.png)
![generated circuit 2 image](/doc/images/circuit_2.png)
![generated demo image](/doc/images/demo.png)
![generated demo tracks image](/doc/images/demo_tracks.png)
![generated mountains image](/doc/images/mountains.png)
![generated polka image](/doc/images/polka.png)
![generated roads image](/doc/images/roads.png)
![generated roads image](/doc/images/roads.png)
![generated rail image](/doc/images/rail.png)
Binary file added doc/images/rail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/WFC.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ function propagate_info(grid, tiles, cell, dir, visited_cells) {
bool ||
(tiles[state].isTileAllowed(tiles[new_state], side) &&
tiles[new_state].isTileAllowed(tiles[state], (side + 2) % 4)),
true
false
);
});
if (len != new_cell.states.length)
propagate_info(grid, tiles, new_cell, side, visited_cells);
propagate_info(grid, tiles, new_cell, -1, visited_cells);
});
}

0 comments on commit 94ad8d2

Please sign in to comment.