# Angled Langton's Ant

Posted 4 years ago
6502 Views
|
2 Replies
|
4 Total Likes
|
 I was thinking on Langton's Ant -- what if we used different angles instead of the square, triangular, or hexagonal grids? The concept of drop/take flags would need to change, and that can be done with a distance parameter. loc = {0, 0}; pts = {}; drops = {}; currentangle = 0; Monitor[Do[ If[Length[pts] > 0 , near = Nearest[pts, loc][]; place = Flatten[Position[pts, near]][]; dist = N[EuclideanDistance[near, loc]], dist = 20]; If[dist < .15, drops = Append[drops, pts[[place]]]; pts = Drop[pts, {place}]; currentangle = currentangle - 2 Pi/5; loc = Chop[loc + N[{Sin[currentangle], Cos[currentangle]}]], pts = Append[pts, loc]; currentangle = currentangle + 2 Pi/5; loc = loc + N[{Sin[currentangle], Cos[currentangle]}]], {g, 1, 3000}], g] It happens to make a highway. Graphics[{Line[pts], Point /@ drops}] With angle set {-2 Pi/5, 2 Pi/5) and distance .15, the ant eventually makes a highway. What other angle sets and distance parameters make highways? For the adventuresome, use flags of different colors, and go into full turmite explorations. Answer
2 Replies
Sort By:
Posted 4 years ago
 Awesome.Does AnglePath simplify the code? What happens long-term? Stephen Wolfram did a live experiment using AnglePath at the Wolfram Summer School, simpler though different from what you see here, but also with the apparent clustering of communities. There are a few examples in the documentation http://reference.wolfram.com/language/ref/AnglePath.html Answer
Posted 4 years ago - Congratulations! This post is now Staff Pick! Thank you for your wonderful contributions. Please, keep them coming! Answer