it seems okay except for one tiny part:
Turing: |
if ans = "LH" then
for c : low .. high
put c
if ans = "HL" then
for c2 : high .. low
put c2
end for
end if
end for
end if
|
try closing the first for loop
after outputting the answer
Turing: |
for c : low .. high
put c
end for
|
and instead of using another if statement, use an elsif statement:
Turing: |
if ans = "LH" then
for c : low .. high
% ouput here
end for
elsif ans="HL" then
for c : high..low
% other output here
end for
end if
|
but you can't have a for loop with high..low (since high>low)
but there's a word you have to add before it to tell the for loop that the numbers are decreasing
see if this help