diff --git a/apps.json b/apps.json index 14e12c164..5eceb019f 100644 --- a/apps.json +++ b/apps.json @@ -5665,8 +5665,8 @@ { "id": "acmaze", "name": "AccelaMaze", "shortName":"AccelaMaze", - "version":"0.01", - "description": "Tilt the watch to roll a ball through a maze", + "version":"0.02", + "description": "Tilt the watch to roll a ball through a maze.", "icon": "app.png", "tags": "game", "supports" : ["BANGLEJS2"], diff --git a/apps/acmaze/ChangeLog b/apps/acmaze/ChangeLog index 5560f00bc..88e918a27 100644 --- a/apps/acmaze/ChangeLog +++ b/apps/acmaze/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Faster maze generation diff --git a/apps/acmaze/app.js b/apps/acmaze/app.js index 53a851b5e..bc5fad9cf 100644 --- a/apps/acmaze/app.js +++ b/apps/acmaze/app.js @@ -35,21 +35,56 @@ function Maze(n) { this.walls[cell] = WALL_RIGHT|WALL_DOWN; this.groups[cell] = cell; } + // Candidates of walls to break when digging the maze. + // If candidate failed (breaking it would create a loop), + // it would never succeed, so no need to retry it. + let candidates_down = [], + candidates_right = []; + for (let r=0 ; r