Random-walk
Generate a random walk within a grid based on the coding challenge of Dan from the coding train. The difference between this random walk and normal ones is that it is self avoiding. This means that the path does not cross itself.
Example
Here's an image of an example self avoiding walk:
This self avoiding walk differs from others by being on a non rectangular lattice. This is implemented by creating lattice vectors to represent the grid points. Other lattices can be implemented by changing the lattice vectors.
Inspiration coding challenge
Lattice Vectors picture
Pivot Algorithm Example Code
Check out the Demo.
Check out the Docs.
Created using p5.js
Todo
[ ] Add Backtracking
[ ] Add pivot algorithm animation
[ ] Add reference to protein folding
Contact Details
Programmer: Omar Essilfie-Quaye omareq08+githubio@gmail.com
(This is an auto-generated document, not all links will necessarily work)