Similar to python, filling the array with an array just create references. We need actual copies.
diff --git a/scripts/main.js b/scripts/main.js
index 8df176b..8f3bbee 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -1,6 +1,6 @@
const DEFAULT_APP_STATE = {
floor: 0, // This is 0-based.
- plan: new Array(FLOOR_COUNT).fill(
+ plan: new Array(FLOOR_COUNT).fill(null).map(() =>
new Array(GRID_SIZE_X * GRID_SIZE_Y).fill(0)),
// mouse_state can be “normal”, or “dnd”.
mouse_state: "normal",