Posted 13 October 2012 - 12:33 AM
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.
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=0 then