Add random scenario and refactor case handling
Consolidate scenario creation by replacing separate normal/edge/clear handlers with createCase({withWalls, scenario}). Add a new 'random' scenario that picks random start/end positions and places random walls (controlled by MAX_RANDOM_WALLS_FACTORS). Change pathLength to a string and display "∞" for empty paths. Update applyGridSize logic to avoid unnecessary resets when dimensions unchanged and to initialize with the new API. Add random helper and MAX_RANDOM_WALLS_FACTORS constant, update template buttons to call createCase, and add i18n entries for the random case and updated clear-board label.
This commit is contained in:
@@ -303,7 +303,8 @@
|
||||
"ASTAR": "Start A*",
|
||||
"NORMAL_CASE": "Test Scenario",
|
||||
"EDGE_CASE": "A* Edge Case Scenario",
|
||||
"CLEAR_BOARD": "Clear Board",
|
||||
"RANDOM_CASE": "Random Case",
|
||||
"CLEAR_BOARD": "Empty Board",
|
||||
"VISITED": "Visited",
|
||||
"PATH": "Path",
|
||||
"PATH_LENGTH": "Path length",
|
||||
|
||||
Reference in New Issue
Block a user