X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/rocl/blobdiff_plain/843ab469ed91b5b4caa07b02be5caa71ef8d04fd..refs/heads/mdw/wip.crybaby.2016-05-05:/elite-describe diff --git a/elite-describe b/elite-describe index 38c9022..8f5cfd4 100755 --- a/elite-describe +++ b/elite-describe @@ -1,12 +1,40 @@ #! /usr/bin/tclsh -# -# $Id: elite-describe,v 1.4 2003/03/10 23:38:18 mdw Exp $ +### +### Describe a particular world +### +### (c) 2003 Mark Wooding +### + +###----- Licensing notice --------------------------------------------------- +### +### This program is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### This program is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with this program; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package require "elite" "1.0.1" +###-------------------------------------------------------------------------- +### Support functions. + proc describe n { + ## Describe the world with seed N. + global economy government + + ## Fetch the necessary information. elite-worldinfo p $n + + ## Format most of the data. puts "Name: $p(name)" puts "Seed: $p(seed)" puts "Position: $p(x), $p(y) LY" @@ -17,6 +45,8 @@ proc describe n { [expr {$p(population)/10.0}] $p(inhabitants)] puts "Gross productivity: $p(productivity) M Cr" puts "Radius: $p(radius) km" + + ## Format the world description, word-wrapping as necessary. puts "" set ll {} set l 0 @@ -29,6 +59,10 @@ proc describe n { puts $ll } +###-------------------------------------------------------------------------- +### Main program. + +## Parse the command line and describe the planets indicated. if {[llength $argv] < 1} { puts stderr "usage: $argv0 \[-g GALAXY\] PLANET ..." exit 1 @@ -58,3 +92,5 @@ for {set i 0} {$i < [llength $argv]} {incr i} { } } } + +###----- That's all, folks --------------------------------------------------