-
Notifications
You must be signed in to change notification settings - Fork 33
/
cuboid_turtle_2.pl
executable file
·51 lines (44 loc) · 977 Bytes
/
cuboid_turtle_2.pl
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
51
#!/usr/bin/perl
use strict;
use warnings;
use GD::Simple;
my $img = 'GD::Simple'->new(3000, 3000);
$img->moveTo(1660, 1780);
my $nr = 314.9;
for (0 .. 44) {
$img->fgcolor('black');
$img->turn($nr);
$img->line(-$nr);
$img->turn(-$nr);
$img->line(-$nr);
$img->turn($nr);
$img->line($nr);
$img->fgcolor('gray');
$img->turn(-$nr);
$img->line($nr);
$img->line($nr);
$img->turn($nr);
$img->line(-$nr);
$img->turn($nr);
$img->line(-$nr);
$img->fgcolor('red');
$img->turn(-$nr);
$img->line($nr);
$img->line(-$nr);
$img->turn($nr);
$img->line(-$nr);
$img->fgcolor('blue');
$img->turn(-$nr);
$img->line($nr);
$img->turn($nr);
$img->line($nr);
$img->line($nr);
$img->fgcolor('purple');
$img->turn(-$nr);
$img->line(-$nr);
$img->line(-$nr);
}
my $image_name = 'cuboid_turtle_2.png';
open my $fh, '>', $image_name or die $!;
print {$fh} $img->png;
close $fh;