with Text_IO, random, calendar; use Text_IO; procedure SAMPLE is package IIO is new Text_IO.Integer_io(integer); --need integer output N:POSITIVE; function seconds return integer is begin return integer(calendar.seconds(calendar.clock)) mod 60; end seconds; procedure random_delay is begin delay duration(float(4.0)*float(random.next)/float(random.modulus)); end; task T is entry SYNC; end T; task body T is begin for I in 1..N loop accept SYNC do null; -- main program is ready! end; random_delay; Put('a'); random_delay; Put('b'); accept SYNC do Put('c'); end SYNC; random_delay; Put('d'); random_delay; Put('e'); accept SYNC do New_Line; end SYNC; end loop; end T; begin text_IO.put("Number of samples? "); iio.get(N); for i in 1..N loop random.init(random.small(2*seconds+1)); T.SYNC; random_delay; Put('1'); random_delay; Put('2'); T.SYNC; random_delay; Put('3'); random_delay; Put('4'); T.SYNC; -- end of line end loop; end SAMPLE;