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 055368f0e548b99d71f118fd850ca6b7aba9e5be..6b227ebe739dae3f4283f233c218c5fbead918c6 100644 (file)
@@ -25,8 +25,6 @@ DATABASE/DICTIONARY MANAGER
 WEBSITE
 -------
 
 WEBSITE
 -------
 
-       route total leagues is wrong
-
        multi-visit routes / circular routes
 
        adjustable potential cost of losses (rather than fixed
        multi-visit routes / circular routes
 
        adjustable potential cost of losses (rather than fixed
index 482c13a3e9969e98e51afab2e8a8878be03bfeb3..7f7d27f45d26d51a25c20b42ff66003e60d6848a 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();
 <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 {
 %      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>
 %      }
 <strong>Sail to <% $islandname |h %></strong>
 - <% $this_dist |h %> leagues </td>
 %      }