RosettaCodeData/Task/Loops-Nested/Lingo/loops-nested.lingo

19 lines
401 B
Plaintext

-- create two-dimensional array with random numbers
a = []
repeat with i = 1 to 20
a[i] = []
repeat with j = 1 to 20
a[i][j] = random(20)
end repeat
end repeat
-- iterate over rows and columns, print value, exit both loops if it's 20
repeat with i = 1 to 20
repeat with j = 1 to 20
v = a[i][j]
put v
if v=20 then exit repeat
end repeat
if v=20 then exit repeat
end repeat