-
-
Save davorg/3d1b58aab00feaaba38098ec838fa6f5 to your computer and use it in GitHub Desktop.
Wall stuff for T
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use SVG; | |
my $PICWIDTH = 22; | |
my $svg = SVG->new(width => 184, height => 200); | |
$svg->rectangle( | |
width => 184, | |
height => 200, | |
x => 0, | |
y => 0, | |
style => { | |
stroke => 'rgb(0,0,0)', | |
fill => 'rgb(255,255,255)', | |
stroke_width => 1, | |
}, | |
); | |
sub picture { | |
my ($svg, $x, $y) = @_; | |
$svg->rectangle( | |
width => $PICWIDTH, | |
height => $PICWIDTH, | |
x => ($x - $PICWIDTH/2), | |
y => $y, | |
style => { | |
stroke => 'rgb(0,0,0)', | |
fill => 'rgb(255,255,255)', | |
stroke_width => 4, | |
}, | |
); | |
} | |
my $gr = $PICWIDTH * .618; | |
my $incr = $PICWIDTH + $gr; | |
my $first = (184 - (4*$PICWIDTH) - (3*$gr)) / 2; | |
$first += $PICWIDTH / 2; | |
my $x = $first; | |
for (1 .. 4) { | |
warn "$x\n"; | |
picture($svg, $x, 50); | |
$x += $incr; | |
} | |
print $svg->xmlify; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment