Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Loops-Nested/Oz/loops-nested.oz
Normal file
24
Task/Loops-Nested/Oz/loops-nested.oz
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
declare
|
||||
fun {CreateMatrix Width Height}
|
||||
Matrix = {List.make Height}
|
||||
in
|
||||
for Row in Matrix do
|
||||
Row = {List.make Width}
|
||||
for X in Row do
|
||||
X = {OS.rand} mod 20 +1
|
||||
end
|
||||
end
|
||||
Matrix
|
||||
end
|
||||
|
||||
proc {PrintMatrix Matrix}
|
||||
%% print until we see 20
|
||||
for Row in Matrix break:OuterBreak do
|
||||
for X in Row do
|
||||
{Show X}
|
||||
if X == 20 then {OuterBreak} end
|
||||
end
|
||||
end
|
||||
end
|
||||
in
|
||||
{PrintMatrix {CreateMatrix 10 10}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue