Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Loops-For/Sather/loops-for.sa
Normal file
20
Task/Loops-For/Sather/loops-for.sa
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class MAIN is
|
||||
-- from, to, step
|
||||
for!(once init:INT, once to:INT, once inc:INT):INT is
|
||||
i ::= init;
|
||||
loop while!( i <= to );
|
||||
yield i;
|
||||
i := i + inc;
|
||||
end;
|
||||
end;
|
||||
|
||||
main is
|
||||
i, j :INT;
|
||||
loop i := for!(1, 5, 1); -- 1.upto!(5)
|
||||
loop j := for!(1, i, 1); -- 1.upto!(i)
|
||||
#OUT + "*";
|
||||
end;
|
||||
#OUT + "\n";
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue