all working

This commit is contained in:
Ryan Voots 2011-05-04 23:31:59 -04:00
parent 8ab2620df7
commit 2faad017f3
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View file

@ -17,17 +17,17 @@ our $world_url = "http://dirkocraft.com:8123/up/world/main/";
our $playerstate = {}; # keep these global! is something funny happenign with the modules?
sub optipeep {
my ($input, $peep) = @_;
my ($peep, $input) = @_;
my $l = length($input);
print "CHECKING $input $peep\n";
#print "CHECKING $input $peep\n";
my $min = [length($peep)*10, $peep]; # set maxes
for my $p (0..length($peep)-length($input)) {
my $subpeep = substr($peep, $p, $l);
my $d = distance($input, substr($peep, $p, $l));
print "LOOKING $p $subpeep $d\n";
#print "LOOKING $p $subpeep $d\n";
if ($d <= $min->[0]) {
$min = [$d, $peep]
}