Posted 22 December 2012 - 05:12 PM
EDIT: Solved, User Error. I actually did know what I was doing.
So I'm making a program that will move a turtle based on tArgs[1]. It sets it to 'command' and then defines all my functions (six directions).
so then I define:
commands[command]()
it works but prints the key (I guess) to the screen. Now I figured out that
commands.command()
dosen't work (although it does print the key). Please help me figure this out.
So I'm making a program that will move a turtle based on tArgs[1]. It sets it to 'command' and then defines all my functions (six directions).
so then I define:
commands = {forward = forward, right = right, left = left, backward = backward,
down = down, up = up }
so that every function has a key that I can call. Now, when I docommands[command]()
it works but prints the key (I guess) to the screen. Now I figured out that
commands.command()
dosen't work (although it does print the key). Please help me figure this out.