3 ### Describe a particular world
5 ### (c) 2003 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This program is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 2 of the License, or
13 ### (at your option) any later version.
15 ### This program is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ### GNU General Public License for more details.
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program; if not, write to the Free Software Foundation,
22 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 package require "elite" "1.0.1"
26 ###--------------------------------------------------------------------------
27 ### Support functions.
30 ## Describe the world with seed N.
32 global economy government
34 ## Fetch the necessary information.
37 ## Format most of the data.
40 puts "Position: $p(x), $p(y) LY"
41 puts "Economy: $economy($p(economy))"
42 puts "Government: $government($p(government))"
43 puts "Tech. level: $p(techlevel)"
44 puts [format "Population: %s billion (%s)" \
45 [expr {$p(population)/10.0}] $p(inhabitants)]
46 puts "Gross productivity: $p(productivity) M Cr"
47 puts "Radius: $p(radius) km"
49 ## Format the world description, word-wrapping as necessary.
53 foreach w $p(description) {
55 incr l [string length $w]
56 if {$l > 72} { puts $ll; set ll {}; set l 0 }
62 ###--------------------------------------------------------------------------
65 ## Parse the command line and describe the planets indicated.
66 if {[llength $argv] < 1} {
67 puts stderr "usage: $argv0 \[-g GALAXY\] PLANET ..."
71 for {set i 0} {$i < [llength $argv]} {incr i} {
72 set a [lindex $argv $i]
76 set a [lindex $argv $i]
77 set g [parse-galaxy-spec $a]
78 if {[string equal $g ""]} {
79 puts stderr "$argv0: bad galaxy string `$a'"
85 set n [parse-planet-spec $g $a]
86 if {[string equal $n ""]} {
87 puts stderr "$argv0: unknown planet `$a'"
96 ###----- That's all, folks --------------------------------------------------