Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
27
Task/Image-noise/PL-I/image-noise.pli
Normal file
27
Task/Image-noise/PL-I/image-noise.pli
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
Image_Noise: procedure options (main); /* 3 November 2013 */
|
||||
declare (start_time, end_time) float (18);
|
||||
declare (frame, m, n) fixed binary;
|
||||
|
||||
start_time = secs();
|
||||
get (m, n);
|
||||
do frame = 1 to 100; /* Generate 100 frames. */
|
||||
call display (m, n);
|
||||
put skip data (frame);
|
||||
end;
|
||||
end_time = secs();
|
||||
|
||||
put skip list ('Average FPS =' || fixed(100/(end_time-start_time), 6) );
|
||||
|
||||
display: procedure (m, n);
|
||||
declare (m, n) fixed binary;
|
||||
declare screen(0:m, 0:n) bit (1);
|
||||
declare i fixed binary;
|
||||
declare random builtin;
|
||||
|
||||
screen = '0'b; /* clear screen for this frame */
|
||||
do i = 0 to m*n*random;
|
||||
screen(random*m, random*n) = random > 0.5;
|
||||
end;
|
||||
end display;
|
||||
|
||||
end Image_Noise;
|
||||
Loading…
Add table
Add a link
Reference in a new issue