Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -Tw
- use strict;
- use SVG;
- my $margin=10;
- my $size=42;
- my $imgsize = 2*$margin + 9*$size;
- my $img=SVG->new(width=>$imgsize, height=>$imgsize);
- my $squares=$img->group(
- id => 'squares',
- style => { stroke=>'black', fill=>'none', "stroke-width"=>1 }
- );
- my $blocks=$img->group(
- id => 'blocks',
- style => { stroke=>'black', fill=>'none', "stroke-width"=>3 }
- );
- foreach my $x (0..8)
- {
- foreach my $y (0..8)
- {
- $squares->rectangle(
- x => $margin + $size * $x,
- y => $margin + $size * $y,
- width => $size,
- height => $size,
- id => "square_$x,$y",
- );
- if($x % 3 == 0)
- {
- $blocks->rectangle(
- x => $margin + $size * $x,
- y => $margin + $size * $y,
- width => $size * 3,
- height => $size,
- id => "block_$x,$y",
- );
- }
- }
- }
- print $img->xmlify();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement