Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
44
Task/Generator-Exponential/PL-I/generator-exponential.pli
Normal file
44
Task/Generator-Exponential/PL-I/generator-exponential.pli
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
Generate: procedure options (main); /* 27 October 2013 */
|
||||
declare j fixed binary;
|
||||
declare r fixed binary;
|
||||
|
||||
/* Ignore the first 20 values */
|
||||
do j = 1 to 20;
|
||||
/* put edit (filter() ) (f(6)); */
|
||||
r = filter ();
|
||||
end;
|
||||
put skip;
|
||||
do j = 1 to 10;
|
||||
put edit (filter() ) (f(6));
|
||||
end;
|
||||
|
||||
/* filters out cubes from the result of the square generator. */
|
||||
filter: procedure returns (fixed binary);
|
||||
declare n fixed binary static initial (-0);
|
||||
declare (i, j, m) fixed binary;
|
||||
|
||||
do while ('1'b);
|
||||
m = squares();
|
||||
r = 0;
|
||||
do j = 1 to m;
|
||||
if m = cubes() then go to ignore;
|
||||
end;
|
||||
return (m);
|
||||
ignore:
|
||||
end;
|
||||
end filter;
|
||||
|
||||
squares: procedure returns (fixed binary);
|
||||
declare i fixed binary static initial (-0);
|
||||
|
||||
i = i + 1;
|
||||
return (i**2);
|
||||
end squares;
|
||||
|
||||
cubes: procedure returns (fixed binary);
|
||||
|
||||
r = r + 1;
|
||||
return (r**3);
|
||||
end cubes;
|
||||
|
||||
end Generate;
|
||||
Loading…
Add table
Add a link
Reference in a new issue