Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Loops-Nested/Lingo/loops-nested.lingo
Normal file
18
Task/Loops-Nested/Lingo/loops-nested.lingo
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
-- 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue