program line5(input, output); uses gralib; label 99; const frametime = 156; { time between frames, 60 cycle refresh } var rndseq: integer; { random sequence seed } procedure wait; var er: evtrec; { event record } begin timer(input, 1, frametime, false); repeat event(input, er) until (er.etype = ettim) or (er.etype = etterm); if er.etype = etterm then goto 99 end; function rand: integer; const a = 16807; m = 2147483647; var gamma: integer; begin gamma := a*(rndseq mod (m div a))-(m mod a)*(rndseq div (m div a)); if gamma > 0 then rndseq := gamma else rndseq := gamma+m; rand := rndseq end; begin rndseq := 1; { set random number generator inital to mid sequence } auto(output, false); curvis(output, false); linewidth(output, 5); while true do begin fcolor(output, color(rand mod 6+ord(red))); line(output, rand mod maxxg(output)+1, rand mod maxyg(output)+1, rand mod maxxg(output)+1, rand mod maxyg(output)+1); wait end; 99: auto(output, true); curvis(output, true) end.