File: movingeye

package info (click to toggle)
libgraphics-libplot-perl 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: perl: 369; ansic: 238; makefile: 5
file content (50 lines) | stat: -rwxr-xr-x 1,659 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl
use Graphics::Libplot ':ALL';

# type of plotting device
$device = 'X';
if (@ARGV) {
    $device = $ARGV[0];	
#    die "Uknown device: $ARGV[0]" unless $ARGV[0] =~ /^X$/;
}


pl_parampl ("VANISH_ON_DELETE", "yes");
pl_parampl ("USE_DOUBLE_BUFFERING", "yes");
     
if (($handle = pl_newpl ($device, stdin, stdout, stderr)) < 0)
         {
           die "Couldn't create Plotter";
         }
pl_selectpl($handle);  #        /* select the Plotter for use */
if (pl_openpl() < 0)    #      /* open Plotter */
{
    die "Couldn't open Plotter";
}
pl_space(0, 0, 299, 149);   #  /* specify user coordinate system */
pl_parampl ("BITMAPSIZE", "300x150");
# Note a bug in XFree86 requires that the bitmap spec comes after newpl().
pl_linewidth (8);           #   /* width of lines in user coordinates */
pl_filltype (1);            #   /* objects will be filled */
pl_bgcolorname ("saddle brown"); # /* background color for the window */
for ($j = 0; $j < 300; $j++)
{
    pl_erase ();              #   /* erase window */
    pl_pencolorname ("red");  # /* choose red pen, with cyan filling */
    pl_fillcolorname ("cyan");
    pl_ellipse ($i, 75, 35, 50, $i); # /* draw an ellipse */
    pl_colorname ("black");   # /* choose black pen, with black filling */
    pl_circle ($i, 75, 12);   #  /* draw a circle [the pupil] */
    $i = ($i + 2) % 300;   #    /* shift rightwards */
}
if (pl_closepl () < 0)        #     /* close Plotter */
{
    die "Couldn't close Plotter";
}
pl_selectpl (0);               #  /* select default Plotter */
if (pl_deletepl ($handle) < 0) # /* delete Plotter we used */
{
    die "Couldn't delete Plotter";
}

1; #OK