home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CONTRSRC.ZIP / SRC / SAM / LISSAJO3.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-11-16  |  1.1 KB  |  40 lines

  1. program lissajous3 ;
  2.  
  3.     uses crt , graph ;
  4.  
  5.     const maxx = 320-48 ; { les - = taille du sprite }
  6.           maxy = 200-48 ;
  7.           maxcompt = 500 ; { 1000 }
  8.           increment = 0.0174 ; { 0.0174 }
  9.  
  10.     var pilotegr , modegr: integer ;
  11.         x , y : longint ;
  12.         i : word ;
  13.         incr : real ;
  14.         f : text ;
  15.         dummy : char ;
  16.  
  17. begin
  18.     assign (f,'lissajo3.dat') ;
  19.     rewrite (f) ;
  20.     pilotegr := CGA ; { hahahahah 320*200 4 couleurs !!! }
  21.     modegr := CGAC1 ;
  22.     initgraph (pilotegr,modegr,'c:\tp') ;
  23.     incr := 0.0 ;
  24.     for i := 0 to maxcompt do
  25.     begin
  26.         x := (maxx div 2) + trunc (cos (5*incr/maxcompt*360)*(maxx div 2))  ;
  27.         y := (maxy div 2) + trunc (sin (4*incr/maxcompt*360)*(maxy div 2))  ;
  28.         putpixel (x,y,i mod 4) ;
  29.         delay (1) ;
  30.         incr := incr + increment ;
  31.         writeln (f,'dw ',((y-1)*320) + (x-1))  ;
  32.     end ;
  33.     directvideo := false ;
  34.     writeln ('Strike ESC key when ready !!!') ;
  35.     dummy := readkey ;
  36.     if dummy = #0 then
  37.          dummy := readkey ;
  38.     close (f) ;
  39.     closegraph ;
  40. end.