Next You can't get there from here 10

Trading

        sub trade {
          my ($items, $sizes, $values, $max_size, $budget) = @_;
          for my $cargo (all_selections($items)) {
            my ($size, $value) = total($sizes, $values, @$cargo);
            if ($size <= $max_size && $value >= $budget) {
              return $cargo;           # Hooray!
            }
          }
          return;
        }

Next Copyright © 2005 M. J. Dominus