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

Please help me shortening my code!

Started by kobkobkob, 20 July 2013 - 11:39 AM
kobkobkob #1
Posted 20 July 2013 - 01:39 PM
Hi guys,
I'm new to all this stuff, but I finally managed to get my code working (after a few days trying). What I ask for you, pros, is to help me shortening my code, so I can learn some more.
Any help improving the code is also welcome! Thanks for all in advance!

Code: http://pastebin.com/AKJZvjr1
Lyqyd #2
Posted 20 July 2013 - 11:16 PM
Split into new topic.
Yevano #3
Posted 20 July 2013 - 11:56 PM
Most of your code looks like it can be shortened with table lookups and for loops. You can, for example, map all of those letters to lists of turtle moves. You could then just have a general algorithm which goes through the moves and has the turtle move given those inputs.
JD_minecraft #4
Posted 23 July 2013 - 08:25 PM
Indeed I think your code can be shortened.

1. Aren't Sai and Roda the same functions?
2. Could you maybe give a very brief explanation about what the code has to do?

Thanks,

JD_minecraft