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

Ok, I need some help with my English to Lua translator

Started by Agent Silence, 07 January 2015 - 06:30 PM
Agent Silence #1
Posted 07 January 2015 - 07:30 PM
I know this may seem like an Ask a Pro topic from the title, but it isn't.

I need you to think of phrases I can add to it so it converts over.

I already have a lot, but I can't think of more

syntax = {
["is equal to"] = "==",
["is the same as"] = "==",
["represents"] = "=",
["repeatedly call"] = "while true do",
["stop"] = "break",
["if the value of"] = "if",
["or else"] = "else",
["stop loop"] = "break",
["start loop"] = "while true do",
["or if"] = "elseif",
["new command"] = "function",
["create command"] = "function",
["new cmd"] = "function",
["create cmd"] = "function",
["new function"] = "function",
["new fnctn"] = "function",
["halt"] = "end",
["wait"] = "sleep",
["not equal to"] = "~=",
}

So can you help me?
EDIT: added some more
Edited on 08 January 2015 - 01:18 AM
Agoldfish #2
Posted 07 January 2015 - 07:59 PM

["halt"] = "end"
Agent Silence #3
Posted 07 January 2015 - 08:15 PM

["halt"] = "end"
thanks
SquidDev #4
Posted 07 January 2015 - 09:06 PM
Looks a bit like HyperTalk (or even better: Inform7 or SPL). You might get some ideas from the syntax from there.
Edited on 07 January 2015 - 08:18 PM
oeed #5
Posted 07 January 2015 - 10:04 PM
Yea, it also resembles AppleScript, which I'm personally not a fan of really.

With 'represents', maybe that's better as just equals?
manu_03 #6
Posted 07 January 2015 - 10:06 PM
["say"] = "print"
Agoldfish #7
Posted 07 January 2015 - 10:26 PM
["put"] = "print"
["echo"] = "print"
cdel #8
Posted 07 January 2015 - 11:37 PM
["not equal to"] = "~="
ByteMe #9
Posted 07 January 2015 - 11:45 PM
I understand the usefulness of symbols to English but I think that while true do makes sense and is also quicker then 'repeatedly call'
other then that, this could help beginners.
KingofGamesYami #10
Posted 07 January 2015 - 11:48 PM
"forever do" = while true do
ByteMe #11
Posted 07 January 2015 - 11:57 PM
"forever do" = while true do
Not bad :P/>
Agent Silence #12
Posted 08 January 2015 - 02:17 AM
I understand the usefulness of symbols to English but I think that while true do makes sense and is also quicker then 'repeatedly call'
other then that, this could help beginners.
I decided to go with "start loop"
ByteMe #13
Posted 08 January 2015 - 07:08 AM
-snip-
I decided to go with "start loop"
Okay that's good, looking forward to seeing this compete or even in a beta.
Agoldfish #14
Posted 08 January 2015 - 06:15 PM
["repeat"] = "again"
["give"] = "return"
["none"] = "nil"
Geforce Fan #15
Posted 10 January 2015 - 11:10 PM
["not"] = "is not"
["if"] = "if it"
(joke) ["Proper variable"] = "local"
lucy-san #16
Posted 11 January 2015 - 01:15 AM
<joke>
["please"] = "if math.random(0,100) < 50 then … end"
</joke>

["walk [up|down|back]"] = "turtle.whatever"
["turn <left|right>"] = "turtle.turn…"
["dig"] = "turtle.dig"
etc. etc.

It will be an intresting thing to see once completed!
Konlab #17
Posted 03 February 2015 - 05:22 PM
Wait x seconds - sleep(x)
wait for something - os.pullEvent
do x times - for i=1,x do
open file/close file/read file - fs.open things
joke:
Flood in rednet:

for i=1,10 do
rednet.broadcast("Hi!")
end
Quintuple Agent #18
Posted 10 February 2015 - 08:29 PM

["is"]="=="
["is not"]="~="
["is more than"]=">"
["is bigger than"]=">"
["is less than"]="<"
["is smaller than"]="<"
The only real problem with small words like 'is' is that you need to make sure it is not followed by another keyword like 'less than', but you might already have that figured out how to fix that :D/>


["ask 'message'"]="write('message') read()"
["they say 'x'"]="read()=='x'"
["said"]="read()"
could be used such as:
if they say "hello" then
or
if "hello" is said then
which would both be the same as
if read()=="hello" then


["open file"]="fs.open"
["close file 'x'"]="x.close()"
["save file 'x'"]="x.flush()"


["the color 'x'"]="colors.'x'"
It would also be nice to have access to the color variables like this
if var is the color red then
Edited on 10 February 2015 - 10:46 PM