+
+ {grid.map((rowArr, i) =>
+ rowArr.map((cell, j) => (
+
handleCellClick(i, j)}
+ onContextMenu={e => handleCellRightClick(i, j, e)}
+ >
+ {cell === CELL.START && "S"}
+ {cell === CELL.END && "E"}
+
+ ))
+ )}
+
+
+ {steps.length > 0 ? (
+ <>
+
# STEPS :
+
+ Step {stepIdx + 1} / {steps.length}
+
+
{currentStep.message}
+
+ {solutionFound === false && stepIdx === steps.length - 1 && (
+
+ No Path Found Between Start and End!
+
+ )}
+ >
+ ) : (
+
+ Start the visualization to see step-by-step progress here.
+
+ )}
+
+
# Instructions
+
+ - Left-click on a cell to toggle a wall (black cell).
+ - Right-click on a cell to move the Start (S) or End (E) point.
+
+
+
# Meaning of cell colors
+
+
+
+
+
+
+
+
+
+
+