#!/usr/local/bin/perl5

#       
#      -----rand(100)----> turn(rand(360))
#                        |
#                        |
#                        |
#                        |
#                        v
           
use Turtle;

$count = $ARGV[0];

$length = 5;

$turtle = Turtle->create(-x=>$length*20,-y=>$length*20);
$turtle->color('red');
$turtle->width(3);

for($i=0;$i<$count;$i++) {
    # $turtle->forward(rand($length*2)-$length);
    $turtle->forward($length);
    $turtle->turn(rand(360));
}

$turtle->MainLoop();

# end
