From: Ian Jackson Date: Wed, 2 Sep 2009 22:44:49 +0000 (+0100) Subject: Calculate total distance correctly X-Git-Tag: 3.4~19 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=c1af6b2456f3313efcb4d40e3df2b628bfb4fae6 Calculate total distance correctly --- diff --git a/yarrg/TODO b/yarrg/TODO index 055368f..6b227eb 100644 --- a/yarrg/TODO +++ b/yarrg/TODO @@ -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 diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 482c13a..7f7d27f 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -597,11 +597,11 @@ $addcols->({ Total => 0, DoReverse => 1 }, qw( % $iquery->execute($islandids[$i]); % my ($islandname) = $iquery->fetchrow_array(); -% my $this_dist= $distance->($islandids[$i-1],$islandids[$i]); -% $total_dist += $this_dist; % if (!$i) { Start at <% $islandname |h %> % } else { +% my $this_dist= $distance->($islandids[$i-1],$islandids[$i]); +% $total_dist += $this_dist; Sail to <% $islandname |h %> - <% $this_dist |h %> leagues % }