Code! Let's make a spot class and a path variable.
9
Code! Now backtracking!
10
Whoops! Copying allOptions was a mistake.
11
Code! Maybe we need an end condition.
12
Yay! It worked.
13
This could take awhile. Could it be improved?
Description:
Explore the fascinating world of self-avoiding walks in this 38-minute video tutorial. Learn how to implement a basic self-avoiding walk using JavaScript and p5.js, then delve into the more complex challenge of backtracking to create a space-filling self-avoiding walk. Visualize the process step-by-step, starting with a simple grid-based approach and progressing to advanced techniques like backtracking and recursion. Discover how to handle edge cases, create a spot class, and optimize your code for better performance. Gain insights into related concepts such as random walks, maze generation, and pathfinding algorithms. Access multiple p5.js Web Editor sketches to experiment with different variations, including 3D self-avoiding walks and implementations using Bezier curves. Perfect for coding enthusiasts looking to enhance their algorithmic problem-solving skills and create visually engaging projects.