chiark
/
gitweb
/
~mdw
/
rocl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a9dd768
)
Fix nonexistent planet error. Make staying put cost nothing.
author
mdw
<mdw>
Mon, 10 Mar 2003 23:37:49 +0000
(23:37 +0000)
committer
mdw
<mdw>
Mon, 10 Mar 2003 23:37:49 +0000
(23:37 +0000)
elite-salesman
patch
|
blob
|
blame
|
history
diff --git
a/elite-salesman
b/elite-salesman
index 03dd4eea273f2280c04cd18333224453c86bbfb6..bfc0f3e75a71afee760699966e8ba886938e411e 100755
(executable)
--- a/
elite-salesman
+++ b/
elite-salesman
@@
-1,6
+1,6
@@
#! /usr/bin/tclsh
#
#! /usr/bin/tclsh
#
-# $Id: elite-salesman,v 1.
1 2003/03/07 00:45:51
mdw Exp $
+# $Id: elite-salesman,v 1.
2 2003/03/10 23:37:49
mdw Exp $
package require "elite" "1.0.1"
package require "vector" "1.0.0"
package require "elite" "1.0.1"
package require "vector" "1.0.0"
@@
-75,8
+75,8
@@
if {[llength $argv] < 2} {
set p [lindex $ww 0]
} else {
set p [parse-planet-spec $g [lindex $argv 1]]
set p [lindex $ww 0]
} else {
set p [parse-planet-spec $g [lindex $argv 1]]
- if {[string equal $
g
""]} {
- puts stderr "$argv0: bad planet spec `
$p
'"
+ if {[string equal $
p
""]} {
+ puts stderr "$argv0: bad planet spec `
[lindex $argv 1]
'"
exit 1
}
if {![in-galaxy-p $g $p]} {
exit 1
}
if {![in-galaxy-p $g $p]} {
@@
-102,6
+102,7
@@
foreach {s x y} $ww {
set j $index($ss)
$av set $i $j [eval $weight [list $s $ss]]
}
set j $index($ss)
$av set $i $j [eval $weight [list $s $ss]]
}
+ $av set $i $i 0
}
destructure {lv pv} [graph-shortest-path $av]
set i $index($p)
}
destructure {lv pv} [graph-shortest-path $av]
set i $index($p)