Mercurial > eagle-eye
annotate attacker_travel.pl @ 362:7f38a5cb769e
dirtry trick
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Mon, 23 Feb 2009 16:26:47 +0800 |
parents | bf59bef30dfc |
children |
rev | line source |
---|---|
352
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
1 #!/usr/bin/perl |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
2 use strict; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
3 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
4 use Data::Dumper; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
5 use Ikariam; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
6 use YAML qw/LoadFile/; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
7 # return minutes. |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
8 sub travelTime { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
9 my ($x1, $y1, $x2, $y2, $speed) = @_; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
10 $speed = 60 unless(defined($speed)); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
11 if($x1 == $x2 && $y1 == $y2) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
12 return 600/$speed; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
13 } else { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
14 return int( (sqrt((abs($x1 - $x2) * abs($x1 - $x2)) + (abs($y1 - $y2) * abs($y1 - $y2)))) * (1200/$speed)); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
15 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
16 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
17 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
18 Ikariam::User->has_many(cities => 'Ikariam::Cities'); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
19 Ikariam::Cities->has_a(island => 'Ikariam::Island'); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
20 Ikariam::Cities->set_sql(ally => qq { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
21 SELECT cities.cityid |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
22 FROM cities |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
23 WHERE cities.ally = ? |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
24 }); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
25 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
26 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
27 sub allyTownToVicim { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
28 my $islandId = shift; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
29 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
30 my $mime = Ikariam::User->retrieve(name => $::user); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
31 my $ally = $mime->ally; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
32 my $iterator = Ikariam::Cities->search_ally($mime->ally); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
33 if(my $island = Ikariam::Island->retrieve($islandId)) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
34 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
35 my @cities = (); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
36 while(my $target = $iterator->next) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
37 my $city; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
38 $city->{id} = $target->id; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
39 $city->{name} = $target->cityname; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
40 $city->{owner} = $target->owner; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
41 $city->{island}->{id} = $target->island->id; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
42 $city->{island}->{x} = $target->island->x; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
43 $city->{island}->{y} = $target->island->y; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
44 $city->{distance} = |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
45 travelTime($target->island->x, $target->island->y, $island->x, $island->y) ; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
46 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
47 push (@cities, $city); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
48 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
49 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
50 @cities = sort { $a->{distance} <=> $b->{distance}; } (@cities); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
51 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
52 for my $x (0..$#cities) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
53 printf("%s (%s)\t- ", $cities[$x]->{name}, $cities[$x]->{owner}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
54 printf("Land %3d Ship %3d Catapult %3d Ram %3d\n", |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
55 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 60), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
56 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 33), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
57 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 26), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
58 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 40), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
59 ); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
60 # last if($x > 5); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
61 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
62 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
63 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
64 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
65 sub myTownToVicim { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
66 my $islandId = shift; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
67 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
68 my @cities = (); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
69 foreach (glob("city-*-dump.yaml")) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
70 my $city = LoadFile($_); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
71 push (@cities, $city); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
72 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
73 my $n = $#cities; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
74 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
75 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
76 if(my $island = Ikariam::Island->retrieve($islandId)) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
77 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
78 for my $x (0..$n) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
79 printf("%s\t- ", $cities[$x]->{name}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
80 printf("Land %3d Ship %3d Catapult %3d Ram %3d\n", |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
81 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
82 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 8), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
83 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 6), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
84 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 10), |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
85 ); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
86 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
87 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
88 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
89 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
90 sub cityToIsland { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
91 my (@city, $island); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
92 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
93 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
94 package main; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
95 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
96 my $userName = $ARGV[0]; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
97 my @cities = (); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
98 if(my $user = Ikariam::User->retrieve(name => $userName)) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
99 foreach my $target ($user->cities) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
100 my $island = $target->island; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
101 my $city; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
102 $city->{id} = $target->id; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
103 $city->{name} = $target->cityname; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
104 $city->{island}->{id} = $island->id; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
105 $city->{island}->{x} = $island->x; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
106 $city->{island}->{y} = $island->y; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
107 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
108 push (@cities, $city); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
109 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
110 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
111 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
112 my $n = $#cities; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
113 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
114 # Print them out. |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
115 # header |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
116 printf(" %5s ", undef); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
117 for my $y (0..$n) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
118 printf ("%5s ", $cities[$y]->{id}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
119 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
120 print "\n"; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
121 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
122 # body |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
123 for my $x (0..$n) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
124 printf(" %5s ", $cities[$x]->{id}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
125 my $total = 0; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
126 for my $y (0..$n) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
127 my $t = travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $cities[$y]->{island}->{x}, $cities[$y]->{island}->{y}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
128 printf("%5s ", $t); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
129 $total += $t; |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
130 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
131 printf(" %s", $cities[$x]->{name}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
132 printf("\n"); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
133 } |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
134 printf("\n"); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
135 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
136 |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
137 for my $i (0..$n) { |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
138 printf("To: %s [%d:%d] http://%s/index.php?view=island&cityId=%s\n", $cities[$i]->{name}, $cities[$i]->{island}->{x}, $cities[$i]->{island}->{y}, $::server, $cities[$i]->{id}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
139 # myTownToVicim($cities[$i]->{island}->{id}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
140 # printf("\n"); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
141 allyTownToVicim($cities[$i]->{island}->{id}); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
142 printf("\n"); |
bf59bef30dfc
scripts for counting travel time
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
143 } |