Set the density before you press the green flag. The path at the end is what the code thinks the best path is (roughly) What the variables are: Density - how much of the maze is filled, 0 is empty, 100 is full. 40 is the highest density that the maze can be solved (maybe up to 50 if you are lucky). Generation - how many times the dots have clones themselves to reach the end of the maze. How the maze solver works: 1. At the start 50 clones are created. 2. The clones move around randomly for a bit 3. Then the 5 clones that are closest to the target are kept - all the others are deleted. 4. Each of those 5 clones make 10 new clones 5. This repeats 50 times until they either get trapped or make it to the end. This works (most of the time) because the closest dots are the ones which are more likely to finish the maze. Yes I know it's not perfect and sometimes they get trapped but overall it's pretty good. Also sometimes they glitch through corners.