Posted 08 November 2012 - 10:26 AM
Hello,
I tried to use functions in the turtle code. My aim was to make commands like moving forward more complex. By that I mean that when I'm calling the function moveforward() (just an example) its checks if theres a block infront of the turtle. If there is a block it reacts to it in some way. If theres no block it just moves forward.
And its supposed to do all of this by just calling my function.
How do I do that?
Heres what I did: http://pastebin.com/0HQsV1ss
I tried to use functions in the turtle code. My aim was to make commands like moving forward more complex. By that I mean that when I'm calling the function moveforward() (just an example) its checks if theres a block infront of the turtle. If there is a block it reacts to it in some way. If theres no block it just moves forward.
And its supposed to do all of this by just calling my function.
How do I do that?
Heres what I did: http://pastebin.com/0HQsV1ss