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

Turtle program needs extra "end"s

Started by MatthewGB, 06 May 2014 - 07:50 PM
MatthewGB #1
Posted 06 May 2014 - 09:50 PM
CC running on MC version 1.5
SMP and SSP

I have created a RC turtle program, but I'm having a problem where I have to add 2 extra ends to make it work. I've checked the indentation several times, and had other programmers check it, but none found a problem with it. The extra ends are causing problems with the program. Pastebin http://pastebin.com/24qgDmwq . Any ideas on how to fix it?
Edited on 06 May 2014 - 07:53 PM
Wojbie #2
Posted 06 May 2014 - 09:55 PM
line 21,
line 36,
-useless "do" that messes stuff up

After removing do's remove 2 ends in lines 73 and 74

Should work :D/>

Edit - Corrected line numbers.
Edited on 06 May 2014 - 07:59 PM
MatthewGB #3
Posted 06 May 2014 - 10:00 PM
On line 38 theres no "do"
print("Action: mv")
Wojbie #4
Posted 06 May 2014 - 10:02 PM
Yea my fault i miswrote lines.
line 21,36 for do's
line 73,74 for ends

I am using pastebin lines calculation also
Edited on 06 May 2014 - 08:04 PM
MatthewGB #5
Posted 06 May 2014 - 10:02 PM
Removed do on line 23, "24: do expected"
Wojbie #6
Posted 06 May 2014 - 10:04 PM
function dig(side) do
to
function dig(side)

and

function docmd(aaction, adir, ax) do
to
function docmd(aaction, adir, ax)

2 ends before
dir = "f"
Edited on 06 May 2014 - 08:05 PM
MatthewGB #7
Posted 06 May 2014 - 10:05 PM
Thanks so much! To sum up, DO NOT PUT A DO AFTER A FUNCTION!
Wojbie #8
Posted 06 May 2014 - 10:05 PM
Yea i am bad at explaining stuff :ph34r:/> Sorry :P/>
Lyqyd #9
Posted 06 May 2014 - 10:08 PM
Moved to Ask a Pro.