Another version, this time named “Self Avoiding Walk II”, which implements a more aggressive backtracking based on the age of each Spot inside container path, so it has a better chance to unstuck itself:
“index.html”:
<script defer src=https://Unpkg.com/processing-js></script>
<canvas data-processing-sources=
"Self_Avoiding_Walk_II.pde Functions.pde Spot.pde Step.pde">
</canvas>