chiark / gitweb /
Calculate total distance correctly
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 2 Sep 2009 22:44:49 +0000 (23:44 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 2 Sep 2009 22:44:49 +0000 (23:44 +0100)
yarrg/TODO
yarrg/web/routetrade

index 055368f..6b227eb 100644 (file)
@@ -25,8 +25,6 @@ DATABASE/DICTIONARY MANAGER
 WEBSITE
 -------
 
-       route total leagues is wrong
-
        multi-visit routes / circular routes
 
        adjustable potential cost of losses (rather than fixed
index 482c13a..7f7d27f 100644 (file)
@@ -597,11 +597,11 @@ $addcols->({ Total => 0, DoReverse => 1 }, qw(
 <tr><td colspan=3>
 %      $iquery->execute($islandids[$i]);
 %      my ($islandname) = $iquery->fetchrow_array();
-%      my $this_dist= $distance->($islandids[$i-1],$islandids[$i]);
-%      $total_dist += $this_dist;
 %      if (!$i) {
 <strong>Start at <% $islandname |h %></strong>
 %      } else {
+%              my $this_dist= $distance->($islandids[$i-1],$islandids[$i]);
+%              $total_dist += $this_dist;
 <strong>Sail to <% $islandname |h %></strong>
 - <% $this_dist |h %> leagues </td>
 %      }