t = {"S","E","N","I","O","R"," ","C","I","N","E","M","A","T","I","C","S"," ","D","E","S","I","G","N","E","R"}
y = {0}
currnt = {0}
buffer = 0
pos = 1
for i=1, 30 do
y[i] = 0
end
print("Stage one:")
for i=1, 26 do
write(t[i])
end
print("")
print("Stage Two:")
while buffer ~= "Stop" do
buffer = read()
table.insert(currnt,pos,buffer)
lttr = t[tonumber(buffer)]
table.insert(y,pos,lttr)
pos = pos+1
end
for i=1, pos do
if y[i]=0 then
write(currnt[i])
else
write(y[i])
end
end
Line 26 is at the end: if y[i]=0 then
[Error] Then Expected
Started by civilwargeeky, Oct 12 2012 11:33 PM
3 replies to this topic
#1
Posted 12 October 2012 - 11:33 PM
So I'm making a simple program to decipher a cipher of sorts. I'm adding more code later to actually decipher, but I ran into an early problem. On line 26 Then Expected.
#2
Posted 12 October 2012 - 11:38 PM
Use
== is the comparison operator, = is the assignment operator.
if y[i]==0 then
== is the comparison operator, = is the assignment operator.
#3
Posted 12 October 2012 - 11:42 PM
Wow thanks. I feel really stupid now...
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users












