#!/usr/local/bin/perl5

use Turtle;

$turtle = Turtle->create();

$turtle->color('red');
$turtle->width(3);


$turtle->color('none');
$turtle->move(100,100);


sub square {
    $turtle->color('black');
    $turtle->move(10,00);
    $turtle->move(00,10);
    $turtle->color('green');
    $turtle->move(-10,00);
    $turtle->move(00,-10);
}

sub right {
    my ($arg) = @_;
    $turtle->color('none');
    $turtle->move($arg,000);
}
sub down {
    my ($arg) = @_;
    $turtle->color('none');
    $turtle->move(00,-$arg);
}

$delta = 20;

for($i=0;$i<5;$i++) {
    &square();
    &right($delta);
}
for($i=0;$i<5;$i++) {
    &square();
    &down($delta);
}
$turtle->MainLoop();
