My second and final program of the night is a castle wall taken from the unused floorplans of the MineColonies plugin. The larger challenge was finding a way to get the “turtle” (the builder) to move from the edge of a previously built wall, get it’s spacing right, and end up at a point where the wall can easily be expanded. The plugin is limited to single movements and placements and like all programming, the programmer is the one with all the intelligence, while the computer just acts literally. If the program messes up with this plugin, the user is left manually destroying the entire project and moving the turtle back to square one, making edits and trying again.
While the spiraling mine was based on some simple math and easy to plan in advance, this was largely dependent upon the location and orientation of the turtle at each step in the process and the blocks around it. Something that is totally different every step of the way. That being said, it wasn’t too difficult, the program just required persistence and patient TDD.
More details, the source, and pictures can be found on my forum post here.