chiark / gitweb /
Fix output formatting a little.
[rocl] / elite-reach
index 7925ef29574826ca4fb0d8a6e045374c4b9eee65..7e72204b30f958d97d3ddab752bae6bc18994d90 100755 (executable)
@@ -1,14 +1,12 @@
 #! /usr/bin/tclsh
+#
+# $Id: elite-reach,v 1.3 2003/03/07 00:41:46 mdw Exp $
 
-package require "elite" "1.0.0"
+package require "elite" "1.0.1"
 
 proc reach {dist seed} {
-  set ww [worldinfo $seed]
-  puts -nonewline stderr "\[computing adjacency table..."
-  adjacency $ww a $dist
-  puts stderr " done\]"
-  puts -nonewline stderr "\[painting..."
-  flush stdout
+  set ww [elite-galaxylist $seed]
+  elite-adjacency a $ww $dist
   foreach {s x w} $ww { set p($s) 1 }
   set pp {}
   while 1 {
@@ -32,7 +30,6 @@ proc reach {dist seed} {
     }
     lappend pp $cc
   }
-  puts stderr " done\]\n"
   foreach cc $pp {
     set de 1
     set l {}
@@ -61,7 +58,7 @@ for {set i 0} {$i < [llength $argv]} {incr i} {
   switch -glob -- $a {
     "-d" {
       incr i
-      set d [expr {[lindex $argv $i] * 10}]
+      set d [expr {int([lindex $argv $i] * 10)}]
     }
     "-*" {
       puts stderr "usage: $argv0 \[-d DIST\] \[GALAXY ...\]"