Mercurial > hg > batmud > misc
changeset 299:61445fa4b804 misc
Delete code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 09 Mar 2015 14:50:25 +0200 |
parents | effde12004ea |
children | ecad4df615cd |
files | materials/parsematerial.pl |
diffstat | 1 files changed, 0 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/materials/parsematerial.pl Mon Mar 09 14:06:38 2015 +0200 +++ b/materials/parsematerial.pl Mon Mar 09 14:50:25 2015 +0200 @@ -537,48 +537,6 @@ } -sub get_alloys($$) -{ - my ($mats, $all) = @_; - my %target = (); - foreach my $mat (@$mats) - { - for (my $i = 3; $i <= 11; $i++) - { - $target{$i} += $data{$mat}{$i} / scalar(@$mats); - } - } - - for (my $i = 3; $i <= 11; $i++) - { - print $target{$i}." "; - } - print "\n"; - - my $res = []; - my $best = 9999999; - foreach my $mat (@$all) - { - next if (grep { $_ eq $mat } @$mats); - - my $val = 0; - for (my $i = 3; $i <= 11; $i++) - { - $val += abs($target{$i} - $data{$mat}{$i}); - } - - push(@$res, $mat) if ($val == $best); - if ($val < $best) - { - $res = [$mat]; - $best = $val; - } - } - - return $res; -} - - ### ### Output functionality begins here ###