RosettaCodeData/Task/Loops-Nested/Lingo/loops-nested.lingo
2016-12-05 23:44:36 +01:00

18 lines
401 B
Text

-- 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