#!/usr/bin/perl -w use strict; use Sheep; use Shepherd; use Field; my $fieldWidth = 500; my $fieldHeight = 500; my @sheep = (); for(my $i = 0; $i < 100; ++$i) { my $randX = sprintf( "%d", rand($fieldWidth)); my $randY = sprintf( "%d", rand($fieldHeight)); my $sheep = new Sheep($randX, $randY); push(@sheep, $sheep); } print "Address of array is: " . \@sheep . "\n"; print "Shepherd now looking for " . @sheep . " sheep\n"; my $field = new Field( $fieldWidth, $fieldHeight, \@sheep); print "Shepherd starting at: 200:300\n"; my $shepherd = new Shepherd(\$field, 200, 300); $shepherd->FindSheep();