all working
This commit is contained in:
parent
8ab2620df7
commit
2faad017f3
2 changed files with 3 additions and 3 deletions
Binary file not shown.
|
@ -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]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue