fun with a worm const qlength=50; var qx{qlength},qy{qlength},tail,head; procedure enqueue(x,y); begin qx{tail}:=x; qy{tail}:=y; tail:=tail+1; if tail=qlength then tail:=0; if tail=head then begin head:=head+1; if head=qlength then head:=0 end end; procedure draw; var i; begin if tail#head then begin i:=head; call cvclear; while i#tail do begin call cvball(qx{i},qy{i},7); i:=i+1; if i=qlength then i:=0 end end end; begin while 1=1 do begin call cvclear; while cvx<0 do call wait(10); tail:=0; head:=0; while cvx>-1 do begin call enqueue(cvx,cvy); call draw; call wait(10); end end end.