
$kame{'-x'} = 0;
$kame{'-y'} = 0;
$kame{'-direction'} = 0;
$kame{'-sin'} = 1;
$kame{'-cos'} = 0;
$kame{'-name'} = "akiko";

$kame = \%kame;

$kame_1{'-x'} = 0;
$kame_1{'-y'} = 0;
$kame_1{'-direction'} = 0;
$kame_1{'-sin'}= 1;
$kame_1{'-cos'}= 0;
$kame_1{'-name'} = "masaru";

$kame_1 = \%kame_1;


sub forward {
    my ($self) = @_;
    $self->{'-x'}  += $self->{'-cos'};
    $self->{'-y'}  += $self->{'-sin'};
}

sub direction {
    my ($self,$dir) = @_;
    $direction = $dir;
    $self->{'-sin'} = sin($self->{'-direction'} / 360 * 3.141592653 * 2);    
    $self->{'-cos'} = cos($self->{'-direction'} / 360 * 3.141592653 * 2); 
}

sub print {
    my ($self) = @_;
    print "$self->{'-name'} $self->{'-x'} $self->{'-y'}\n";
}

&direction($kame_1,-90);

&forward($kame);
&direction($kame,90);
&print($kame);

&forward($kame_1);
&print($kame_1);

&forward($kame);
&print($kame);

&forward($kame_1);
&print($kame_1);
&forward($kame);
&print($kame);

&forward($kame_1);
&print($kame_1);
&forward($kame);
&print($kame);

&forward($kame_1);
&print($kame_1);
