#! /usr/bin/tclsh
#
-# $Id: elite-pairs,v 1.3 2003/02/26 00:02:51 mdw Exp $
+# $Id$
-package require "elite" "1.0.0"
+package require "elite" "1.0.1"
proc ok {s vv expr} {
global argv0
}
"-d" {
incr i
- set d [expr {[lindex $argv $i] * 10}]
+ set d [expr {int([lindex $argv $i] * 10)}]
}
"-v" {
incr v
}
default {
break
- }
+ }
}
}
if {$i != [llength $argv] - 2} {
exit 1
}
destructure {aexpr bexpr} [lrange $argv $i end]
-puts -nonewline stderr "\[computing adjacency table..."
-flush stderr
-set ww [worldinfo $g]
-adjacency $ww adj $d
-puts stderr " done\]"
+set ww [elite-galaxylist $g]
+elite-adjacency adj $ww $d
unset a
foreach {s x y} $ww {
if {![ok $s {} $aexpr]} { continue }
elite-worldinfo a $s
set l {}
foreach {ss xx yy} $adj($s) {
- set d [world-distance $x $y $xx $yy]
+ set d [elite-distance $x $y $xx $yy]
if {[ok $ss {a d} $bexpr]} {
- set d [expr {[world-distance $x $y $xx $yy]/10.0}]
+ set d [expr {[elite-distance $x $y $xx $yy]/10.0}]
if {$v} {
puts [format "%s (%.1f LY)" [world-summary $s] $d]
puts [world-summary $ss]
puts ""
} else {
- puts [format "%-11s %-11s (%.1f LY)" $a(name) [worldname $ss] $d]
+ puts [format "%s %s (%.1f LY)" \
+ [world-brief $s] [world-brief $ss] $d]
}
}
}