Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Loops-Nested/Icon/loops-nested-1.icon
Normal file
10
Task/Loops-Nested/Icon/loops-nested-1.icon
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
procedure main()
|
||||
|
||||
every !(!(L := list(10)) := list(10)) := ?20 # setup a 2d array of random numbers up to 20
|
||||
|
||||
every i := 1 to *L do # using nested loops
|
||||
every j := 1 to *L[i] do
|
||||
if L[i,j] = 20 then
|
||||
break break write("L[",i,",",j,"]=20")
|
||||
|
||||
end
|
||||
4
Task/Loops-Nested/Icon/loops-nested-2.icon
Normal file
4
Task/Loops-Nested/Icon/loops-nested-2.icon
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
every x := L[i := 1 to *L,1 to *L[i]] do
|
||||
if x = 20 then break write("L[",i,",",j,"]=20") # more succinctly
|
||||
|
||||
every if !!L = 20 then break write("Found !!L=20") # even more so (but looses the values of i and j
|
||||
Loading…
Add table
Add a link
Reference in a new issue