This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jackmott's profile picture

Random hedge mazes

Started by jackmott, 29 September 2015 - 11:41 AM
jackmott #1
Posted 29 September 2015 - 01:41 PM
This code will build a random hedge maze. It first uses a maze algorithm to build a maze in memory, then moves around to place bushes at ground level where the maze is. These will then later grow 3 blocks high and form a nice maze. You can very easily modify it to place some other block however high you want though.


Screenshot:
http://i.imgur.com/M6QcpKU.png

Code:
http://pastebin.com/4mqdr9Qi
Bomb Bloke #2
Posted 30 September 2015 - 03:22 AM
That's pretty cool, but I can't help thinking it's a bit plain-jane…

Would you maybe consider having the turtle randomly choose between different berry types while building? Bonus points if the maze can be paved and lit!
jackmott #3
Posted 30 September 2015 - 04:14 PM
Those are rather trivial modifications, to be left as an exercise for the reader.

Actually adding paving and lights could get complex for large mazes as you will have to come back for more resources!


Another interesting extension would be to extend it into 3 dimensions. placing ladders on the up and down paths.
jackmott #4
Posted 30 September 2015 - 04:58 PM
THE THIRD DIMENSION
http://i.imgur.com/bWRLLfz.jpg
jackmott #5
Posted 01 October 2015 - 09:23 PM
Well adding a third dimension to the random maze in memory - super easy.
Getting the turtle to build it is a big task!
Coming along though. Testing on an 11x11x7 3d maze now
It is a bit tedious if something goes wrong and you have to break it all down!
Bomb Bloke #6
Posted 01 October 2015 - 11:21 PM
It is a bit tedious if something goes wrong and you have to break it all down!

A command computer and a few nested "for" loops are the way to go there. :)/>
jackmott #7
Posted 02 October 2015 - 03:03 PM
I only play survival mode. For aesthetic reasons =)
Thankfully there is some useful buildcraft stuff for these purposes.
jackmott #8
Posted 02 October 2015 - 09:17 PM
It's happening
http://imgur.com/9VSlLxc
jackmott #9
Posted 02 October 2015 - 10:15 PM
muahahah http://i.imgur.com/V7VW3Mm.png