[comp.sources.games] v04i100: xconq5 - version 5 of the strategy game for X-windows and curses, Part12/18

games@tekred.TEK.COM (07/01/88)

Submitted by: "Stanley T. Shebs" <shebs%defun@cs.utah.edu>
Comp.sources.games: Volume 4, Issue 100
Archive-name: xconq5/Part12



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 12 (of 18)."
# Contents:  help.c lib/2planets.map lib/europe.map order.c output.c
# Wrapped by billr@saab on Wed Jun 29 08:55:55 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f help.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"help.c\"
else
echo shar: Extracting \"help.c\" \(14632 characters\)
sed "s/^X//" >help.c <<'END_OF_help.c'
X/* Copyright (c) 1987, 1988  Stanley T. Shebs, University of Utah. */
X/* This program may be used, copied, modified, and redistributed freely */
X/* for noncommercial purposes, so long as this notice remains intact. */
X
X/* RCS $Header: help.c,v 1.1 88/06/21 12:30:12 shebs Exp $ */
X
X/* This file is devoted to commands and other functions related specifically */
X/* to help.  Almost all of the xconq help code is here. */
X
X/* At least in X, the help window covers most of the xconq display, so */
X/* total redraws are necessary.  This can be slow - fix would be to do */
X/* per-window redrawing only as need, and place help window to cover as few */
X/* of the other windows as possible (especially world map). */
X
X#include "config.h"
X#include "misc.h"
X#include "period.h"
X#include "side.h"
X#include "unit.h"
X#include "map.h"
X
Xextern int helpwinlines;
X
X/* Display the news file on stdout if it exists, be silent if it doesn't. */
X/* (Used only during program startup.) */
X
Xmaybe_dump_news()
X{
X    FILE *fp;
X
X    make_pathname(XCONQLIB, NEWSFILE, "", spbuf);
X    if ((fp = fopen(spbuf, "r")) != NULL) {
X	while (fgets(spbuf, BUFSIZE-1, fp) != NULL) {
X	    fputs(spbuf, stdout);
X	}
X	fclose(fp);
X    }
X}
X
X/* The general help command.  It first lists the available commands, */
X/* then a legend to map display, then the current news about xconq, then */
X/* details about the period/units.  Player can page screens back and forth, */
X/* which explains some odd index adjusts at bottom of loop. */
X
Xx_help(side)
XSide *side;
X{
X    int i = side->reqvalue2;
X    char opt = side->reqch;
X
X    init_wprintf(side, NULL);
X    switch (opt) {
X    case ' ':
X    case 'n':
X	if (i < 4+period.numutypes) i++;
X	break;
X    case '-':
X	if (i > 0) i--;
X	break;
X    default:
X	conceal_help(side);
X	redraw(side);
X	return;
X    }
X    switch (i) {
X    case 0:
X	command_help(side);
X	break;
X    case 1:
X	legend_help(side);
X	break;
X    case 2:
X	make_pathname(XCONQLIB, NEWSFILE, "", spbuf);
X	if (!show_file(side, spbuf)) {
X	    wprintf(side, "No news is good news.");
X	}
X	break;
X    case 3:
X	describe_mapfiles(side);
X	break;
X    case 4:
X	describe_period(side);
X	break;
X    default:
X	/* i guaranteed to be in right range */
X	describe_utype(side, i - 5);
X	break;
X    }
X    ask_help_char(side);
X    request_input(side, NULL, x_help);
X    side->reqvalue2 = i;
X}
X
X/* The command proper must request a character for whether to go to next */
X/* or previous screen, or to quit entirely. */
X
Xdo_help(side, n)
XSide *side;
Xint n;
X{
X    if (reveal_help(side)) {
X	init_wprintf(side, NULL);
X	command_help(side);
X	ask_help_char(side);
X	request_input(side, NULL, x_help);
X	side->reqvalue2 = 0;
X    }
X}
X
X/* Prompt for a char from help window. */
X
Xask_help_char(side)
XSide *side;
X{
X    char *help = "[Space bar to continue, '-' for prev, all else quits]";
X
X    draw_fg_text(side, side->help, 0, (helpwinlines-1)*side->fh, help);
X}
X
X/* Generate a legend for all the various symbols and pictures. */
X/* (Does not include cursor box or tiny side numbers.) */
X
Xlegend_help(side)
XSide *side;
X{
X    int t, u, tcol = 2 * side->margin + side->hw;
X    int spacing = side->hh + 4 * side->margin;
X    int offset = side->hh/4, second = 30*side->fw;
X
X    /* first column of things is constant for all periods */
X    draw_blast_icon(side, side->help,
X		    side->margin, 0*spacing, 'b', side->enemycolor);
X    draw_fg_text(side, side->help, tcol, 0*spacing+offset, "miss");
X    draw_blast_icon(side, side->help,
X		    side->margin, 1*spacing, 'c', side->enemycolor);
X    draw_fg_text(side, side->help, tcol, 1*spacing+offset, "hit");
X    draw_blast_icon(side, side->help,
X		    side->margin, 2*spacing, 'd', side->enemycolor);
X    draw_fg_text(side, side->help, tcol, 2*spacing+offset, "kill");
X    for_all_terrain_types(t) {
X	draw_hex_icon(side, side->help,
X		      side->margin, (t+3)*spacing,
X		      (side->monochrome ? side->fgcolor : side->hexcolor[t]),
X		      (side->monochrome ? ttypes[t].tchar : HEX));
X	draw_fg_text(side, side->help,
X		     tcol, (t+3)*spacing+offset, ttypes[t].name);
X    }
X    for_all_unit_types(u) {
X	draw_unit_icon(side, side->help,
X		       second, u*spacing, u, side->fgcolor);
X	draw_fg_text(side, side->help,
X		     second+tcol, u*spacing+offset, utypes[u].name);
X    }
X}
X
X/* This command provides a short note about the current hex.  It is */
X/* useful as a supplement to the general help command. */
X
Xdo_ident(side, n)
XSide *side;
Xint n;
X{
X    char view = side_view(side, side->curx, side->cury);
X    char t = terrain_at(side->curx, side->cury);
X    Side *side2;
X
X    if (view == UNSEEN) {
X	notify(side, "You see unexplored territory");
X    } else if (view == EMPTY) {
X	notify(side, "You see unoccupied %s", ttypes[t].name);
X    } else {
X	side2 = side_n(vside(view));
X	notify(side, "You see a %s %s (in the %s)",
X	       (side2 == NULL ? "neutral" : side2->name),
X	       utypes[vtype(view)].name, ttypes[t].name);
X    }
X}
X
X/* Dump out the characteristics of a single unit type.  This works by */
X/* jumping into the help loop, so all the other types can be looked at also. */
X
Xx_unit_info(side)
XSide *side;
X{
X    int u;
X
X    if ((u = find_unit_char(side->reqch)) >= 0) {
X	if (u != NOTHING) {
X	    if (reveal_help(side)) {
X		init_wprintf(side, NULL);
X		describe_utype(side, u);
X		ask_help_char(side);
X		request_input(side, NULL, x_help);
X		side->reqvalue2 = u;
X	    }
X	}
X	clear_prompt(side);
X    } else {
X	request_input(side, NULL, x_unit_info);
X    }
X}
X
X/* The command proper just prompts and issues the request. */
X
Xdo_unit_info(side, n)
XSide *side;
Xint n;
X{
X    ask_unit_type(side, "Details on which unit type?", NULL);
X    request_input(side, NULL, x_unit_info);
X}
X
X/* Spit out all the general period parameters in a readable fashion. */
X
Xdescribe_period(side)
XSide *side;
X{
X    int u, r, t, i;
X
X    wprintf(side, "This period is named \"%s\".", period.name);
X    wprintf(side, "");
X    wprintf(side,
X	"It includes %d unit types, %d resource types, and %d terrain types.",
X	    period.numutypes, period.numrtypes, period.numttypes);
X    wprintf(side, "First unit type is %s, first product type is %s.",
X	    (period.firstutype == NOTHING ? "none" :
X	     utypes[period.firstutype].name),
X	    (period.firstptype == NOTHING ? "none" :
X	     utypes[period.firstptype].name));
X    wprintf(side, "");
X    wprintf(side,
X	    "Countries are %d hexes across, between %d and %d hexes apart.",
X	    period.countrysize, period.mindistance, period.maxdistance);
X    wprintf(side, "Known area is %d hexes across.", period.knownradius);
X    wprintf(side, "Default scale is %d km/hex.", period.scale);
X    if (period.allseen)
X	wprintf(side, "All units are always seen by all sides.");
X    wprintf(side, "");
X    if (period.counterattack)
X	wprintf(side, "Defender always gets a counter-attack.");
X    else
X	wprintf(side, "Defender does not get a counter-attack.");
X    wprintf(side, "Neutral units add %d%% to defense, hit over %d is a nuke.",
X	    period.neutrality, period.nukehit);
X    if (period.efficiency > 0)
X	wprintf(side, "Unit recycling is %d%% efficient.", period.efficiency);
X    wprintf(side, "");
X    for_all_terrain_types(t) {
X	wprintf(side, "Terrain:  %c  %s (%s)",
X		ttypes[t].tchar, ttypes[t].name, ttypes[t].color);
X    }
X    wprintf(side, "");
X    for_all_resource_types(r) {
X	wprintf(side, "Resource: %c  %s (%s)",
X		' ', rtypes[r].name, rtypes[r].help);
X    }
X    wprintf(side, "");
X    for_all_unit_types(u) {
X	wprintf(side, "Unit:     %c  %s (%s)",
X		utypes[u].uchar, utypes[u].name, utypes[u].help);
X    }
X    wprintf(side, "");
X    if (period.notes != NULL) {
X	for (i = 0; period.notes[i] != NULL; ++i) {
X	    wprintf(side, "%s", period.notes[i]);
X	}
X    }
X}
X
X/* Full details on the given type of unit.  This may be used either for */
X/* online help or for building a descriptive file.  The icon will only */
X/* show up for online help, otherwise the display calls have no effect. */
X
Xdescribe_utype(side, u)
XSide *side;
Xint u;
X{
X    int r, t, u2;
X
X    wprintf(side, "     '%c' %s      (territory value %d)",
X	    utypes[u].uchar, utypes[u].name, utypes[u].territory);
X    wprintf(side, "            %s", utypes[u].help);
X    if (utypes[u].bitmapname != NULL)
X	wprintf(side, "     bitmap \"%s\"", utypes[u].bitmapname);
X    else 
X	wprintf(side, "");
X    draw_hex_icon(side, side->help, side->margin, side->margin,
X		  side->fgcolor, HEX);
X    draw_unit_icon(side, side->help, side->margin, side->margin,
X		   u, side->bgcolor);
X    wprintf(side, "Init: %d in country, %d/10000 hexes density, %s.",
X	    utypes[u].incountry, utypes[u].density,
X	    (utypes[u].named ? "named" : "unnamed"));
X    wprintf(side, "Maximum speed %d hexes/turn, %d%% under control. %s %s",
X	    utypes[u].speed, utypes[u].control,
X	    (utypes[u].onemove ? "(auto)" : ""),
X	    (utypes[u].jumpmove ? "(jumps)" : ""));
X    wprintf(side, "%d HP, crippled at %d HP, chance to retreat %d%%.",
X	    utypes[u].hp, utypes[u].crippled, utypes[u].retreat);
X    wprintf(side, "%d%% extra for start up, %d%% extra for R&D.",
X	    utypes[u].startup, utypes[u].research);
X    wprintf(side, "%d extra moves used up by an attack.",
X	    utypes[u].hittime);
X    wprintf(side,
X        "%d%% to succumb to siege, %d%% to revolt, attrition damage %d HP.",
X	    utypes[u].siege, utypes[u].revolt, utypes[u].attdamage);
X    if (utypes[u].seerange == 1) {
X	wprintf(side, "Chance to see others %d%%.", utypes[u].seebest);
X    } else {
X	wprintf(side, "Chance to see %d%% at 1 hex, to %d%% at %d hexes.",
X		utypes[u].seebest, utypes[u].seeworst, utypes[u].seerange);
X    }
X    wprintf(side, "Own visibility is %d.", utypes[u].visibility);
X    if (utypes[u].volume > 0 || utypes[u].holdvolume > 0)
X	wprintf(side, "Volume is %d, volume of hold is %d.",
X		utypes[u].volume, utypes[u].holdvolume);
X    wprintf(side, "%s %s",
X	    (utypes[u].changeside ? "Can be made to change sides." : ""),
X	    (utypes[u].disband ? "Can be disbanded and sent home." : ""));
X    wprintf(side, "%s %s",
X	    (utypes[u].maker ? "Builds units all the time." : ""),
X	    (utypes[u].selfdestruct ? "Hits by self-destruction." : ""));
X    wprintf(side, "");
X    wprintf(side, "%s",
X	    "  Resource   ToBui  Prod Store  Eats ToMov  Hits HitBy");
X    wprintf(side, "%s",
X	    "               (0)   (0)   (0)   (0)   (0)   (0)   (0)");
X    for_all_resource_types(r) {
X	sprintf(spbuf, "%10s: ", rtypes[r].name);
X	append_number(spbuf, utypes[u].tomake[r], 0);
X	append_number(spbuf, utypes[u].produce[r], 0);
X	append_number(spbuf, utypes[u].storage[r], 0);
X	append_number(spbuf, utypes[u].consume[r], 0);
X	append_number(spbuf, utypes[u].tomove[r], 0);
X	append_number(spbuf, utypes[u].hitswith[r], 0);
X	append_number(spbuf, utypes[u].hitby[r], 0);
X	wprintf(side, "%s", spbuf);
X    }
X    wprintf(side, "");
X    wprintf(side, "%s",
X	    "   Terrain  Slowed Rand% Hide% Defn% Prod% Attr% Acdn%");
X    wprintf(side, "%s",
X	    "               (-)   (0)   (0)   (0)   (0)   (0)   (0)");
X    for_all_terrain_types(t) {
X	sprintf(spbuf, "%10s: ", ttypes[t].name);
X	append_number(spbuf, utypes[u].moves[t], -1);
X	append_number(spbuf, utypes[u].randommove[t], 0);
X	append_number(spbuf, utypes[u].conceal[t], 0);
X	append_number(spbuf, utypes[u].defense[t], 0);
X	append_number(spbuf, utypes[u].productivity[t], 0);
X	append_number(spbuf, utypes[u].attrition[t], 0);
X	append_number(spbuf, utypes[u].accident[t], 0);
X	wprintf(side, "%s", spbuf);
X    }
X    wprintf(side, "");
X    wprintf(side, "%s%s",
X	    "     Hit%  Damg  Cap% Guard  Pro%",
X	    " Holds Enter Leave  Mob% Bridg Build   Fix");
X    wprintf(side, "%s%s",
X	    "      (0)   (0)   (0)   (0)   (0)",
X	    "   (0)   (1)   (0) (100)   (0)   (0)   (0)");
X    for_all_unit_types(u2) {
X	sprintf(spbuf, "%c: ", utypes[u2].uchar);
X	append_number(spbuf, utypes[u].hit[u2], 0);
X	append_number(spbuf, utypes[u].damage[u2], 0);
X	append_number(spbuf, utypes[u].capture[u2], 0);
X	append_number(spbuf, utypes[u].guard[u2], 0);
X	append_number(spbuf, utypes[u].protect[u2], 0);
X	append_number(spbuf, utypes[u].capacity[u2], 0);
X	append_number(spbuf, utypes[u].entertime[u2], 1);
X	append_number(spbuf, utypes[u].leavetime[u2], 0);
X	append_number(spbuf, utypes[u].mobility[u2], 100);
X	append_number(spbuf, utypes[u].bridge[u2], 0);
X	append_number(spbuf, utypes[u].make[u2], 0);
X	append_number(spbuf, utypes[u].repair[u2], 0);
X	wprintf(side, "%s", spbuf);
X    }
X    wprintf(side, "");
X}
X
X/* A simple table-printing utility. Blanks out default values so they don't */
X/* clutter the table. */
X
Xappend_number(buf, value, dflt)
Xchar *buf;
Xint value, dflt;
X{
X    if (value != dflt) {
X	sprintf(tmpbuf, "%5d ", value);
X	strcat(buf, tmpbuf);
X    } else {
X	strcat(buf, "      ");
X    }
X}
X
X/* Dump assorted information into files, so they can be studied at leisure, */
X/* or by people with screens too small for online help. */
X
Xdo_printables(side, n)
XSide *side;
Xint n;
X{
X    int u;
X
X    init_wprintf(side, CMDFILE);
X    command_help(side);
X    finish_wprintf();
X    notify(side, "Dumped commands to \"%s\".", CMDFILE);
X    init_wprintf(side, PARMSFILE);
X    describe_period(side);
X    for_all_unit_types(u) {
X	wprintf(side, "--------------------------------------------------");
X	wprintf(side, "");
X	describe_utype(side, u);
X	wprintf(side, "");
X    }
X    finish_wprintf();
X    notify(side, "Dumped period data to \"%s\".", PARMSFILE);
X    dump_view(side);
X    notify(side, "Dumped current view to \"%s\".", VIEWFILE);
X}
X
X/* Put the current view into a file. */
X
Xdump_view(side)
XSide *side;
X{
X    char ch1, ch2;
X    int x, y, i, view, vs;
X    Side *side2;
X    FILE *fp;
X
X    if ((fp = fopen(VIEWFILE, "w")) != NULL) {
X	for (y = world.height-1; y >= 0; --y) {
X	    for (i = 0; i < y; ++i) fputc(' ', fp);
X	    for (x = 0; x < world.width; ++x) {
X		view = side_view(side, x, y);
X		if (view == UNSEEN) {
X		    ch1 = ch2 = ' ';
X		} else if (view == EMPTY) {
X		    ch1 = ttypes[terrain_at(x, y)].tchar;
X		    ch2 = (side->showmode == BORDERHEX ? ' ' : ch1);
X		} else {
X		    ch1 = utypes[vtype(view)].uchar;
X		    vs = vside(view);
X		    side2 = side_n(vside(view));
X		    ch2 = (side2 ? ((side == side2) ? ' ' : vs + '0') : '`');
X		}
X		fputc(ch1, fp);
X		fputc(ch2, fp);
X	    }
X	    fprintf(fp, "\n");
X	}
X    } else {
X	notify(side, "Can't open \"%s\"!!", VIEWFILE);
X    }
X}
X
X/* This kicks in on a unit type prompt.  Just give barest details, rely */
X/* on general help for full unit descriptions.  This could be spiffier */
X/* and use the help window, but getting the interaction right is just too */
X/* hard... */
X
Xhelp_unit_type(side)
XSide *side;
X{
X    int u;
X
X    for_all_unit_types(u) {
X	if (side->bvec[u]) {
X	    notify(side, " %c  %s;  %s",
X		   utypes[u].uchar, utypes[u].name, utypes[u].help);
X	}
X    }
X}
END_OF_help.c
if test 14632 -ne `wc -c <help.c`; then
    echo shar: \"help.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lib/2planets.map -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"lib/2planets.map\"
else
echo shar: Extracting \"lib/2planets.map\" \(1116 characters\)
sed "s/^X//" >lib/2planets.map <<'END_OF_lib/2planets.map'
XXconq 0 --+--+ saved game
XMap 158 40 1000 1 0
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X12:4_75:4_63:
X10:9_70:9_60:
X9:+..4+4.+67:+..4+4.+58:
X8:+.+^7+4.64:+.+^7+4.56:
X7:+..^5+,4+..++61:+..^5+,4+..++54:
X6:3+.+^4+,6+..++58:3+.+^4+,6+..++52:
X6:.+..^^++,6+4.3+57:.+..^^++,6+4.3+51:
X6:+.+..^8+4.+.+^+56:+.+..^8+4.+.+^+50:
X6:.3+.5+5.+5.+^~55:.3+.5+5.+5.+^~49:
X6:+.3+,6+6.5+^^54:+.10+6.5+^^48:
X6:.5+..5+7.++^^_^53:.5+..5+7.++^^_^47:
X7:..6+11.++^+^^54:..6+11.++^+^^47:
X8:..3+5~+7.5+^55:..3+5~+7.5+^47:
X9:.4+..=4~5.+..3+56:.4+..+4~5.+..3+47:
X10:.4+..=5~7.++57:.4+..+5~7.++47:
X11:..6+5~+,6.58:+.6+5~+,6.47:
X13:12+6.61:12+6.48:
X15:+3.3+8.64:++..3+8.49:
X17:3.3^6.67:..3^7.50:
X19:9_70:9_51:
X22:4_75:4_53:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
X158:
XUnits 19 1 0
X* Darth*Valley*Junction 92,25 -1
X* Yodaville 27,22 -1
X* Neda 106,22 -1
X* Ya-ya 16,21 -1
X* Jabba 90,20 -1
X* Ewoktown 6,19 -1
X* Foo 85,19 -1
X* Bar 26,18 -1
X* Pits 105,18 -1
X* Endor 18,16 -1
X* Dry 97,16 -1
X* Tatooine 12,15 -1
X* Mjb 91,15 -1
X* Egm 31,14 -1
X* Star*City 110,14 -1
X* Cape*Canaveral 17,12 -1
X* Cold 96,12 -1
X@ Rebel*Yell 11,20 -1
X@ Imperial 95,21 -1
END_OF_lib/2planets.map
if test 1116 -ne `wc -c <lib/2planets.map`; then
    echo shar: \"lib/2planets.map\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lib/europe.map -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"lib/europe.map\"
else
echo shar: Extracting \"lib/europe.map\" \(14549 characters\)
sed "s/^X//" >lib/europe.map <<'END_OF_lib/europe.map'
XXconq 0 --+--+ saved game
XMap 240 200 50 1 0
X13.++.22%++5.3+93%99.
X11.++..+22%+6.3+93%66.,32.
X9.6%++19%++7.,3+93%98.
X9.27%+7.4+94%98.
X7.14%^13%+%8.4+14%,,17%,,59%97.
X7.13%^13%3+7.5+6%,9%,14%,%%,,58%97.
X5.7%^22%++8.5+6%,10%,13%,,%%,58%96.
X5.5%4^22%+8.5+5%,,6%,3%,14%4,58%96.
X4.,5%^^__3^19%+10.%3+4%,%,5%,,%,,16%4,57%95.
X3.6%^^_^^_^19%++10.%++12%,5%,3%3.9%5,56%95.
X3.6%^^__^%3^17%3+10.%++15%3,4%6.9%,,56%94.
X3.5%3^__^%%^^17%++11.3+15%,6%7.66%94.
X4.5%^%^__^^20%++12.++14%,7%7.66%93.
X4.7%^3_^21%,12.++22%+6.,+64%93.
X5.8%^_3^20%,12.++22%+6.++64%92.
X5.7%__^23%,12.4+19%3+5.++64%92.
X7.++%%^^__^24%11.,+%%3+9%12+..6+62%91.
X6.4+%3^_25%11.3+%+%10+5.7+.8+38%+22%91.
X7.4+%%^_^26%10.14+11.12+38%++21%90.
X7.4+3^_^26%++12.8+11.14+19%,,5%+%%++%%+3%++%+20%90.
X9.++^^3_^^4%3+17%3+11.7+11.8+%+%+%3+18%++,,+3%+3%+4%3+23%89.
X8.%++%^^_^^4%5+14%5+10.,.5+11.10+4%++19%,++,%++%+%%+4%3+3%++3%+15%89.
X9.4%^_3^4%5+14%7+21.+,.,14+11%+8%+%%,+3,%%+%+%+%+%%,5%+3%+15%72.+15.
X9.3%+3^6%5+13%8+18.8+%%+%3+%+%+13%+6%5+5,7+,++,6+%%+%+15%66.++20.
X10.4%^^7%++.+12%9+,16.11+17%+5%+5%7+3,9+3,9+8%+8%60.+4.7+15.
X11.3%^8%++.++11%5+.,,+16.9+,,30%21+,6+%+%+6%+9%65.6+16.
X12.11%3+.++7%3,%6+,3+14.5+%4+3,3%,,+22%27+%%+9%++8%63.7+16.
X12.9%4+..+8%3,10+12.+.,5+%%3+3,++%3,8%++11%30+10%++8%62.7+17.
X13.7%3+5.+4%,,%4,7+15.,..5+%%4+,,3%+%,7%+13%17+%13+%+%%+5%+8%62.6+17.
X13.7%++7.4%,,%4,6+,16.,.4+3%4+,,8+19%12+%4+%18+4%+7%+%62.10+13.
X15.6%+8.%3+4,8+,14.3+.,3+6%3+,,+%%4+10%++6%5+%9+%5+%++%++%10+%%+5%+%+%%60.14+10.
X16.5%+8.%3+3,++,,5+15.3+3.,+3%+3%3+,3%4+9%++6%+%3+%%5+%%24+%++4%+%%++%%61.13+10.
X31.%8+,,5+22.4%++%%10+17%3+%+%7+%+%5+%+%6+%+%9+%10+60.14+9.
X31.,7+,,%%4+22.16+16%6+%%++%%+%%++%%3+%+%4+%11+%14+60.13+10.
X33.6+,,4%3+17.%5.14+8%++7%8+%%+3%+%6+%+%17+%8+%4+60.11+11.
X33.6+,5%3+16.3%4.%13+9%++6%6+%+%5+4%4+%%++%3+%13+%%10+61.9+,11.
X28.,+4.4+%%3+4%++5.+9.,+3%3.+%13+10%+5%6+%%8+%+%3+3%4+%%+%23+60.10+11.
X28.++5.3+%4+4%++5.+9.++3%..,3%11+10%3+3%8+%8+%%+%+4%4+5%5+%4+%11+62.7+12.
X28.++6.++%%4+4%+,14.++5%++3%12+8%3+3%+%7+%9+%++%+%+%4+%+%%++%20+62.8+10.
X24.++.3+7.+%%4+4%+15.4%++%3+3%10+%%+%++%3+4%+%%6+3%4+%+%++%++%+%5+4%6+3%+%3+%%3+%3+50.++.++8.8+9.
X25.7+,6.+%4+3%+15.,+%5+7%10+%++%%3+4%+%+3%7+%10+%+%++%5+%7+%+3%12+49.8+5.9+8.
X25.6+8.5+%%3+,,13.14+%24+3%+%6+%13+%11+%3+4%+%11+49.9+3.11+7.
X26.8+6.4+3%3+15.,41+%6+%13+%%7+%7+4%+%%10+44.++3.9+3.11+6.
X25.9+6.4+%%4+16.40+%%++%26+%8+6%3+%6+44.14+3.11+6.
X27.6+6.+.7+.+,16.25+%7+%++%3+%%8+%11+%6+3%+%4+%++5%++%7+43.15+4.10+5.
X26.7+4.,++.5+21.+%26+%11+%4+%+%13+%%6+3%6+%+10%6+43.15+7.7+5.
X27.6+3.,4+.5+21.27+%9+%9+%%21+4%6+%+%+4%+%%5+43.14+7.9+3.
X27.7+..4+,.5+22.26+%12+%++%%5+%7+%++%7+4%3+%7+5%+%5+43.13+5.+..9+3.
X28.,8+.3+..4+23.26+%%3+%3+%8+%4+%10+%8+4%+%8+7%5+44.12+9.9+1.
X28.,,7+.3+29.25+%+%4+%%5+%10+%3+%4+%8+5%3+%+%6+4%6+43.13+10.8+1.
X+30.4+.,..,++8.+17.+,,33+%%14+%3+%+%++%%8+%+%%8+%%+%++%%7+43.13+9.,8+
X+28.,.4+3.3+26.32+%18+3%+%%++%12+%%+%%6+3%+%11+42.13+10.9+
X++28.,,4+5.,.,14.5+6.19+%16+%13+6%17+%+%5+5%12+40.15+5.,.11+
X++,28.,5+20.7+3.50+3%22+%%7+%+%+%%10+40.15+5.7+%5+
X3+30.7+4.,4+8.++%+%%++,,5+3%25+%3+%12+3%++%%25+%+4%+%11+39.15+6.12+
X3+,29.7+..5+,.,4.,9+%++%6+%%32+%8+%%4+%29+%9+%4+39.14+7.12+
X4+28.+.,25+%29+%10+%++%%+%7+%+3%4+%44+40.5+.++12.11+
X4+24.3+,3+,14+,.23+%3+%4+%19+%%10+%%+%3+%%18+%10+%14+60.11+
X9+14.,3+..3+.42+%8+%++%7+%30+%43+58.12+
X10+13.,4+,3+,45+3%10+%11+%14+%5+%20+%3+%%5+%13+57.13+
X11+12.14+3%38+3%7+%82+56.,12+
X11+8.++,+.14+%++%15+%+%%++%24+4%++%13+%3+%58+59.10+
X11+9.++,,+.15+%%13+%%3+3%20+%5+7%++3%7+%62+60.8+
X11+8.3+,,16+%%15+%33+13%16+%+%49+64.4+
X10+,9.36+%26+%7+12%17+%52+57.10+
X9+10.37+%%34+12%17+%51+56.11+
X10+10.40+%35+11%13+%%3+%12+%32+%++55.11+
X11+9.22+%13+%+%+%36+10%13+%17+%35+54.12+
X11+,6.,+.22+%%6+3%6+%%34+11%13+%18+%35+57.3+3.,1+
X..+3.+.,4.32+%4+%45+12%30+%%35+65.
X13.22+%56+%5+%%++3%+3%30+%36+64.
X13.21+%%++%38+%15+%47+%34+64.
X14.22+4%102+%%33+63.
X13.,12+%9+4%42+3%11+%%46+%32+63.
X..++8.13+%%9+4%18+5%+%19+%26+%66+62.
X..3+5.13+3%11+%%19+%27+%++%35+%%20+%%8+%5+%14+62.
X3.5+..13+4%12+%3+3%3+%%6+%%22+%4+%+%%+%19+%14+%+%%++%32+%13+61.
X3.19+%%3+3%13+%%5+%4+%16+%++%9+%++%++%3+%12+%%23+%%30+%%12+61.
X4.34+%4+%%10+%18+%+%13+%%++%+%6+%3+%27+%31+%12+53.7+
X++..33+%%3+3%3+%6+%16+8%8+%%3+%14+%3+%23+,30+%12+53.,6+
X38+%%4+%%++%%6+%%19+%%+%11+%++%+%7+%%3+%26+,43+54.5+
X37+%%4+3%3+%7+%17+3%+%+%11+%++%41+,42+54.5+
X29+%%6+3%4+%%12+%19+4%+%^^9+%%++%40+,12+..27+55.,2+
X29+%++%4+%%3+%36+%+3%^%4+%+7%++%38+,10+4.27+57.1+
X,27+3%++%3+%%3+3%6+4%6+3%13+%%++5%^++3%+%+3%+^^%39+,9+,..29+57.
X..25+%%3+%3+%%4+%%7+%%10+%20+12%+%+%^^%37+,10+,.30+57.
X3.,27+%%5+%4+%7+%%14+%16+6%++%+%++3%+%^^%4+%29+,,9+.,4.28+56.
X4.18+%6+%%26+%%9+%17+%13+%+%%^%%3+%27+,9+.,,5.,27+56.
X5.18+%6+%8+%4+%+%10+%%3+%38+%++%3^%%28+,8+,+.,,6.,26+55.
X5.17+%6+%13+%%9+5%++%%42+3^%+%+%24+,8+..3,6.28+55.
X6.17+%32+7%8+3%22+%3+%%++%+4^%+%%3+%19+,8+,.5,5.28+54.
X7.45+4%+%^4%+%3^%%4^3+,19+%+%++%++%+%3^%%+%%16+,,.,,7+.,..7,3.28+54.
X9.32+%8+%+8^%14^24+%+%+%4+%3^%+%+%15+4.5+,,3+,6.++..22+3%5+53.
X9.,29+%%8+^%%6^+12^4%23+%10+%^%^%+%++%13+5.3,3.5+,4.++.,19+%6^4+53.
X11.27+3%4+^%%23^%^33+%4+^%^^%%+%14+9.9+,4+3.15+%%10^++52.
X11.27+^^++%+%11^_16^11+,16+%^%3+%3+%^%^%%+%%12+10.13+6.7+%%11^4_^^+52.
X11.28+^+,+27^3%^10+,,17+^^%+%%4+3%^+%++%10+,10.10+14.++%%9^6_^^+51.
X12.26+%++^%26^14+,,16+%+3%9+%+%+3%9+14.8+16.++%6^4_^4_^+51.
X12.+.10+%+%%13+%15^_^^%5^%3^%%^^32+%11+^+%++%8+,15.3+21.++15^+50.
X12.%.12+%^3+%8+%4^3_^^%15^++%^%++%44+^^+%%9+16.++24.++^^+10^+50.
X13.%.5+%%5+%^++%%8+6^_^^4%6^+^^%37+%6+%%3+3%+3%+%%10+16.++29.5+^^%%^+33.+15.
X12.%%.3+3%5+%^^++%%8+%3^_3^++6%^^+^^%44+%3^%7^+%++%9+49.9+32.4+13.
X13.3%4+%6+%^^%+4%4+%4^_3^6+%4+%%41+%++3%3^5%^4+%%8+,51.6+%+28.11+9.
X13.3%12+%%^^%%^4+%%4^_^%20+3.3+^28+%%+3^%^^3+%%4+%10+53.3+%^^+28.14+6.
X13.4%12+%5^%3+%3^_3^%20+4.4+%9+%+%16+%+^%7+%+3%12+54.+4^+28.9+%6+3.
X13.5%11+%^%3^4+%3^_3^20+5.5+%8+3%+%12+%%14+%+%%10+54.+4^+28.8+4^%5+1.
X4+9.7%10+3%^%5+%7^20+5.13+3%3+%14+%11+%13+55.+4^+28.6+%10^1%
X^4+,7.3+4%10+4%++%++3%6^7+%%12+5.12+%%6+%10+%%11+%14+55.5^+27.7+%%+%8^
X^^%7+.22+%3+%++3%+5^7+%^%9+9.+.3+%+%+3%+%++3%9+%++%+%23+54.+5^+27.5+%^%%3^3%3^
X^3%33+%+4%+%6^%3+.4+%8+10.3+3%^%+%%5+%10+%+%25+53.+6^+27.3+%+%5^6%1^
X6%9+%15+%9+3%+%3^%^^++5.3+^^6+11.4+%^^%+^%+%++%+%12+%23+53.5^_^+26.,++%^%+%3^%%++3%
X6%8+%4^%22+%++%^^5+7.3+%7+10.5+4^%%+4%10+%+%24+53.+^_^^_^^+27.7+4%4+2%
X++4%^%8+%6^13+3.11+12.12+9.4+%5^%+^4%35+50.++^^_3^_^^+26.11+%5+
X%+3%4^%7+8^%%7+8.7+14.6+%5+9.,4+%^^%%^+^%++%33+28.3+16.4+%6^_3^+26.16+1%
X++4%6^5+3%10^%3+10.4+16.13+9.5+%^%3^5%^^3%6+^%21+23.4+%%6+10.+%9^_4^+26.16+
X++5%5^7+%^+9^3+13.+16.14+9.7+%6^%3^+^7+^^%19+21.+%%^^%%17+16^+26.11+%4+
X3+6%5^10+%8^++30.14+10.7+%8^4%4+%%++%%++3%^%10+21.++^^4%4+%%4+%++%19^+25.11+4%1+
X3+%%3^%%4^%9+%+6^3+31.9+%3+11.6+%10^6+^%%4+%^%++%+%%4+%%++19.3%^^%%3^%%^3%++%23^+24.12+4%1+
X5%7^3%14+%6+25.+6.8+^^++13.+..3+^%5^%3+%+%+^^%%^6+%+10%+18.+4%4^%++^^++^%3+22^+24.5+^5+5%
X^^%%8^%%22+23.3+6.8+^^%++15.3+4%3^7+%^^%%^^%4+13%+16.+%%++6^%+%%++%%25^+23.8+8%1^
X7^4%4^3%18+23.+^++7.7+3^++17.5+3^3+%3+%^^++4^4+3%+%%+%%+%%+15.+4%7^%^%^%+%+%24^+22.4+%9+%2^
X3^%^%%++%%5^%^%16+24.+^%+8.6+%^^%+,18.3+%%3+^^+%++^^%+5^%^++4%+%++4%+12.++3%8^%+7%25^+22.++3%9+3^
X10+3%7^14+27.+%+9.5+%^^4+18.4+%%^^%6+3%7^16+3.++%%3+%+9^%++%3^%%27^+21.17+
X10+3%8^%8+31.+%+10.4+%^%^%4+17.3+%4^%4+%^^+7^5%12+.6+%%+%8^%3+%32^+20.18+
X12+%%9^%%3+34.++13.3+%%3^8+14.++6^5+%++%++%%^7%+%4+6.6+%%10^%^%%32^+20.17+
X%10+3%9^%3+35.++14.5+%%7+15.++^%^%%9+%5+%%+%+4%++8.6+%3^%^%^%3^%%+%%19^%9^%%+20.7+%9+
X4+3%5+3%9^3+53.6+%6+14.++%4^%+%%^17+%+%++7.8+%^3+%%+%^^%^%^%%16^%7^%+%4+20.3+5%8+
X5+3%4+3%7^%3+37.3+14.14+14.3+^%^^+%^12+3.+,6+..+..11+^+%+%+%+^^%^%19^%%5^%%6+21.3+4%8+
X7+%%5+9%3+37.+%++18.13+11.3+^%%^3%9+..+8.++..7+%+%%+%^3+%%+%4^%21^%5^3%6+21.3+%%9+
X15+6%4+36.6+19.13+10.3+5^+%8+11.+3.8+5^7%+%3^3%25^%%^^%++%%+21.3+%10+
X25+16.+20.6+21.3+%%7+,7.3+%5^+%^7+12.11+%%5^4%^3%3^%%^%%21^++%3^%^^%+20.14+
X12+4%9+12.+24.6+22.3+%9+7.++%3^%+^+%++..3+10.14+%6^7%^^3%22^%4+%^%+%3+20.++%11+
X12+3%^%++%%5+11.4+22.3+%%+22.++3%3+3.3+6.+%+%3^4+^++14.12+%%9^4%3^4%19^%14+20.++%10+
X10+5%^^4%5+5.+4.4+%22.3+%++23.++%%3+5.++5.3+%%^^%4+%+14.10+%15^%3^5%17^%15+19.4+%9+
X15+^^%9+4.+7.%%23.6+24.3+%++6.+7.3+3^7+16.8+%%17^5%13^+%^%%15+19.4+%8+
X14+%^%%6+%3+36.6+26.+%+15.++%%^^%7+12.12+%^%26^_^^%3^%++%%15+21.11+
X14+5^9+37.6+26.3+15.3+%%^^%6+13.++.11+%27^%%+%+^+%^%15+27.4+
X10+%^++5^6+,39.5+28.4+14.3+%%^^5+18.9+3%13^%11^4%++%+%%16+28.3+
X10+%^^%+%%^^%6+40.5+28.+^^++14.4+^%%5+.+14.9+%++%%13^4%6^3%4+^19+29.1+
X10+%%^^%%3^6+41.3+30.+%^++16.3+%^6+.++9.+.7+3%+5%21^%%6+%19+29.1,
X.8+%%+%5^%6+76.3+17.3+%3^4+..++8.+.5+%%+%+%+%%^%21^%5+..20+29.
X5+%7+5^%++80.++18.5+3%8+11.4+8%5^%15^%%6+.21+29.
X.20+80.++%20.5+.5+16.%%+4%7^3%14^%+7.21+28.
X..4+10.4+81.+%22.+6.%%4+11.+.+%%+3%7^%%+4%6^+%^^+8.20+~28.
X4.+96.+%22.,.+%^^+.%.4+13.%%+%+^%7^%7+5^%4+9.19+~27.
X101.++22.3+3%+%%3.++13.++5%6^%%+5.++5^%++10.18+~~27.
X3.3+82.8+%^++27.3+^%++%8.+10.%%6+4^%++8.%^^3+11.17+4~25.
X..4+82.10+%29.3+%++.+18.%3.,..3+^^3+9.3+13.9+%%^%~+6~25.
X3.5+82.10+30.3+%+11.+17.+^^%++26.7+4%++7~24.
X..4+%+32.++3.9+38.6+%31.6+21.+6.+^++28.6+%%5+7~24.
X3.4+%++24.22+..10+4.7+15.7+30.+.+.++20.++28.+9.14+5~24.
X..7+%++20.13+%12+%20+3.+14.4+31.+.+22.+27.++11.4+%11+~~24.
X3.+%%4+4^5+8.13+5%+5%++4%^%25+16.+36.+47.++12.+^+3%+%%6+3~23.
X.3+3%4+%3^6+6.13+%%^^%+%^4%~^3%3^%%++%18+101.4+11.6^%^%%8~23.
X12+%3^%23+4%4+%4+~~3^12%4+3~5+102.+%%+11.+5^5%8~22.
X14+%%22+6%9+3~4^10%++6~4+103.++12.+4^%%++10~18.4+
X25+%%3^%%++5%4^%%4+%%3+6~3^7%3+6~4+117.+4^4+10~14.7+
X6+4%++%^%6+12^%3^%5^%%+7%+6~5^6%++7~3+16.+44.++..5+47.+3^5+10~12.9+
X++%+%^%5^%3^%++3^%%20^10%+7~10^%^6~6+59.10+46.+^^6+10~10.10+
X+%%+%12^+6^%19^5%6^7~12^7~5+64.3+48.+^^5+11~9.11+
X3+3%11^+%19^%%15^10~10^7~5+115.++%3+%%11~9.10+
X5+%%9^%%16^%^^%17^14~^^~^^8~5+115.6+^^%10~7.12+
X6+%9^%%34^~^^28~5+114.7+%^^10~6.12+
X5+11^%33^14~,,17~5+114.7+%^^10~5.13+
X3+%%43^17~4,15~4+115.4+%3+%11~4.13+
X+%45^18~3,~,13~4+116.8+12~4.++%10+
X7^3_36^20~3,~,3~,,8~+119.3+,+%3+11~4.+%^^%%4+2%
X5^7_31^41~+119.6+%++11~3.++%10^
X4^__33^46~++118.7+%+11~3.+8^__1^
X16^~3^4~12^49~++..++114.7+%%11~3.3+%8^
X15^4~^^6~8^52~3+116.4+,++%%11~3.7+%3^
X15^3~4^6~3^56~5+113.~4+,+%%12~3.5+%5^
X12^7~3^67~4+113.~~3+,+%%12~..4+%6^
X10^10~^^68~3+,,110.3~5+^%12~4+%8^
X4^~3^~~^11~^^68~6+,45.7+53.6~4+^^12~++%9^
X5~3^86~6+3.3+35.11+40.++7.10~3+^^12~+%10^
X95~15+31.12+39.5+..+12~++%^^6~^5~+%~3^5~
X97~14+29.8+~~4+..++32.9+.12~++%^^5~^^16~
X101~14+,24.6+7~11+24.13+13~+%^^5~3^8~+5~
X102~3+3~8+23.4+11~10+5.,17.3+3~6+3~,11~++%^6~^^14~
X112~5+23.3+12~28+4.3+6~++17~+~^7~3^12~
X113~4+23.++14~++3~+~~26+6~++5~,13~^^6~^^13~
X116~3+23.++22~24+8~+19~^^20~
X117~++23.++23~+4~+~15+10~+4~+.10~.~3^19~
X119~4+20.++31~6+4,12~3+5~.10~.~4^17~
X119~10+14.+34~+5,14~3+6~.4~^^3~.~3^18~
X121~13+10.+34~3,18~+7~.5~^3~.~4^16~
X121~14+9.+33~4,18~+8~.3~3^~~..%3^6~3^7~
X125~++~~9+6.++32~3,19~+9~,.3~^^%~..%~~3^~6^6~
X131~8+4.++38~,16~+10~..~~3^~..4~^^~~5^6~
X136~10+55~+11~..6~3.7~4^5~
X137~8+57~+10~3.4~6.6~3^5~
X180~3,21~+10~3.~8.13~
X181~,,22~+11~11.12~
X206~+12~11.10~
X207~+11~13.8~
X208~+12~13.6~
X208~+10~%+~13.5~
X208~+11~^%~15.2~
X221~3+14.2~
XUnits 186 1 0
X* Trondheim 15,197 -1
X* Bergen 7,181 -1
X@ Leningrad 77,181 -1
X* Helsinki 62,180 -1
X* Oslo 24,176 -1
X* Tallinn 65,175 -1
X* Stockholm 47,174 -1
X* Ivanovo 115,174 -1
X@ Gorki 128,173 -1
X* Aberdeen 230,167 -1
X* Goteborg 33,164 -1
X* Dundee 228,163 -1
X@ Moscow 114,162 -1
X* Riga 72,161 -1
X* Glasgow 225,160 -1
X* Edinburgh 228,160 -1
X* Helsingborg 40,156 -1
X* Tula 121,155 -1
X* Belfast 220,155 -1
X* Copenhagen 40,153 -1
X* Newcastle 236,153 -1
X* Odense 35,151 -1
X* Kaunas 79,149 -1
X* Dublin 221,149 -1
X* Leeds 237,149 -1
X* Lipeck 134,148 -1
X* Liverpool 231,148 -1
X* Kaliningrad 69,147 -1
X* Bransk 116,147 -1
X* Kiel 36,146 -1
X* Gdansk 63,146 -1
X* Manchester 235,146 -1
X@ Minsk 94,145 -1
X* Sheffield 239,145 -1
X* Cork 213,143 -1
X* Nottingham 0,142 -1
X* Voronez 137,142 -1
X@ Hamburg 37,141 -1
X* Bremen 33,140 -1
X@ Birmingham 239,140 -1
X* Cardiff 233,137 -1
X* Amsterdam 21,136 -1
X* The*Hague 20,135 -1
X* Hannover 39,135 -1
X@ Berlin 52,135 -1
X* Bristol 236,135 -1
X@ London 6,134 -1
X* Poznan 63,134 -1
X@ Warsaw 79,134 -1
X* Rotterdam 22,133 -1
X* Magdeburg 47,133 -1
X* Volgograd 165,133 -1
X@ Kharkov 134,132 -1
X* Antwerp 22,131 -1
X* Plymouth 232,131 -1
X* Dusseldorf 30,130 -1
X* Essen 32,130 -1
X* Lodz 75,130 -1
X* Calais 13,129 -1
X* Lublin 87,129 -1
X* Leipzig 51,128 -1
X* Wroclaw 68,128 -1
X@ Kiev 115,128 -1
X* Lille 20,127 -1
X* Brussels 24,127 -1
X* Dresden 57,127 -1
X* Liege 28,126 -1
X* Cologne 32,126 -1
X* Bonn 34,126 -1
X* Cherbourg 4,124 -1
X* Le*Havre 10,123 -1
X* Wiesbaden 38,123 -1
X* Frankfurt 40,123 -1
X* Katowice 78,123 -1
X@ Donetsk 147,123 -1
X@ Prague 61,122 -1
X* Krakow 80,122 -1
X* Lvov 98,121 -1
X@ Dnepropetrovsk 137,121 -1
X* Brest 234,121 -1
X* Reims 25,120 -1
X* Luxembourg 33,120 -1
X* Mannheim 42,119 -1
X* Nurnberg 52,118 -1
X@ Paris 20,117 -1
X* Brno 72,117 -1
X* Strasbourg 40,114 -1
X* Stuttgart 46,114 -1
X* Nantes 7,112 -1
X* Tours 15,111 -1
X@ Munich 56,111 -1
X@ Vienna 74,111 -1
X* Bratislavia 78,111 -1
X* Kisinov 122,109 -1
X* Dijon 33,108 -1
X* Basel 42,108 -1
X* Krasnodar 164,108 -1
X* Zurich 47,107 -1
X@ Budapest 87,107 -1
X@ Odessa 131,107 -1
X* La*Rochelle 10,106 -1
X* Innsbruck 58,106 -1
X* Berne 43,104 -1
X* Lausanne 42,103 -1
X* Geneva 40,102 -1
X* Lyon 35,99 -1
X* La*Coruna 223,98 -1
X* Bordeaux 16,97 -1
X* Trieste 71,96 -1
X* Zagreb 79,96 -1
X@ Torino 48,95 -1
X* Venice 67,95 -1
X* Ploesti 122,95 -1
X@ Bucharest 123,93 -1
X* Belgrade 100,92 -1
X* Vigo 222,92 -1
X* Bilbao 9,91 -1
X* Bayonne 14,91 -1
X* Genoa 54,91 -1
X* Bologna 65,90 -1
X* Toulouse 25,89 -1
X* Porto 224,87 -1
X* Marseille 42,86 -1
X* Nice 48,86 -1
X* Sarajevo 95,86 -1
X* Toulon 45,85 -1
X* Florence 67,85 -1
X* Ancona 76,85 -1
X@ Sofia 119,81 -1
X* Zaragoza 20,80 -1
X* Bastia 61,80 -1
X* Plovdiv 124,80 -1
X@ Barcelona 33,77 -1
X@ Madrid 9,76 -1
X* Ajaccio 61,76 -1
X* Skopje 113,76 -1
X@ Istanbul 144,76 -1
X@ Rome 77,75 -1
X* Tirane 108,73 -1
X* Lisbon 224,73 -1
X* Bursa 149,72 -1
X@ Ankara 164,72 -1
X* Bari 96,71 -1
X* Sassari 62,70 -1
X@ Naples 86,70 -1
X* Thessaloniki 123,69 -1
X* Valencia 24,68 -1
X* Taranto 100,68 -1
X* Palma 37,66 -1
X* Cordoba 8,63 -1
X* Alicante 27,63 -1
X* Seville 2,62 -1
X* Cagliari 68,62 -1
X* Izmir 148,60 -1
X* Cadiz 0,58 -1
X* Aleppo 196,58 -1
X* Malaga 10,57 -1
X* Gibraltar 4,56 -1
X* Almeria 19,56 -1
X* Athens 135,55 -1
X* Tangier 3,53 -1
X* Palermo 91,53 -1
X* Messina 99,53 -1
X@ Algiers 46,50 -1
X* Catania 100,49 -1
X* Nicosia 185,48 -1
X* Oran 31,47 -1
X* Constantine 63,47 -1
X* Tunis 80,47 -1
X* Rabat 1,46 -1
X@ Casablanca 237,44 -1
X* Iraklion 151,42 -1
X* Beirut 200,42 -1
X@ Damascus 205,41 -1
X* Haifa 203,36 -1
X* Marrakech 237,33 -1
X* Tel*Aviv 204,32 -1
X* Amman 210,31 -1
X* Jerusalem 208,30 -1
X* Tripoli 103,24 -1
X* Port*Said 199,23 -1
X* Benghazi 140,21 -1
X@ Cairo 198,17 -1
X* Suez 204,16 -1
X@ Milan 54,96 -1
X@ Alexandria 190,22 -1
END_OF_lib/europe.map
if test 14549 -ne `wc -c <lib/europe.map`; then
    echo shar: \"lib/europe.map\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f order.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"order.c\"
else
echo shar: Extracting \"order.c\" \(6140 characters\)
sed "s/^X//" >order.c <<'END_OF_order.c'
X/* Copyright (c) 1987, 1988  Stanley T. Shebs, University of Utah. */
X/* This program may be used, copied, modified, and redistributed freely */
X/* for noncommercial purposes, so long as this notice remains intact. */
X
X/* RCS $Header: order.c,v 1.1 88/06/21 12:30:30 shebs Exp $ */
X
X#include "config.h"
X#include "misc.h"
X#include "dir.h"
X#include "period.h"
X#include "side.h"
X#include "unit.h"
X
Xchar *ordernames[] = ORDERNAMES;   /* full names of orders */
Xchar *dirnames[] = DIRNAMES;       /* short names of directions */
Xchar orderbuf[BUFSIZE];            /* buffer for printed form of an order */
Xchar oargbuf[BUFSIZE];             /* buffer for order's arguments */
X
Xint orderargs[] = ORDERARGS;       /* types of parameters for each order */
X
X/* General routine to wake a unit up (and maybe all its cargo). */
X
Xwake_unit(unit, wakeocc)
XUnit *unit;
Xbool wakeocc;
X{
X    Unit *occ;
X
X    unit->orders.type = AWAKE;
X    unit->orders.rept = 0;
X    unit->orders.flags = NORMAL;
X    if (wakeocc) {
X	for_all_occupants(unit, occ) wake_unit(occ, wakeocc);
X    }
X}
X
X/* Stash a "wakeup call" - will only be for main unit, not occupants. */
X
Xcache_awake(side)
XSide *side;
X{
X    side->tmporder->type = AWAKE;
X    side->tmporder->rept = 0;
X    finish_teach(side);
X}
X
X/* Give a unit sentry orders. */
X
Xorder_sentry(unit, n)
XUnit *unit;
Xint n;
X{
X    unit->orders.type = SENTRY;
X    unit->orders.rept = n;
X}
X
X/* Stash sentry orders. */
X
Xcache_sentry(side, n)
XSide *side;
Xint n;
X{
X    side->tmporder->type = SENTRY;
X    side->tmporder->rept = n;
X    finish_teach(side);
X}
X
X/* Fill in the given unit with direction-moving orders. */
X
Xorder_movedir(unit, dir, n)
XUnit *unit;
Xint dir, n;
X{
X    unit->orders.type = MOVEDIR;
X    unit->orders.p.dir = dir;
X    unit->orders.rept = n;
X}
X
Xcache_movedir(side, dir, n)
XSide *side;
Xint dir, n;
X{
X    side->tmporder->type = MOVEDIR;
X    side->tmporder->p.dir = dir;
X    side->tmporder->rept = n;
X    finish_teach(side);
X}
X
X/* Give the unit orders to move to a given place - it only needs to do this */
X/* once, repetition is nonsensical. */
X
Xorder_moveto(unit, x, y)
XUnit *unit;
Xint x, y;
X{
X    unit->orders.type = MOVETO;
X    unit->orders.rept = 1;
X    unit->orders.p.pt[0].x = x;
X    unit->orders.p.pt[0].y = y;
X}
X
Xcache_moveto(side, x, y)
XSide *side;
Xint x, y;
X{
X    side->tmporder->type = MOVETO;
X    side->tmporder->rept = 1;
X    side->tmporder->p.pt[0].x = x;
X    side->tmporder->p.pt[0].y = y;
X    finish_teach(side);
X}
X
X/* Order to follow an edge just needs to remember the direction. */
X
Xorder_edge(unit, d, n)
XUnit *unit;
Xint d, n;
X{
X    unit->orders.type = EDGE;
X    unit->orders.rept = n;
X    unit->orders.p.dir = d;
X}
X
Xcache_edge(side, d, n)
XSide *side;
Xint d, n;
X{
X    side->tmporder->type = EDGE;
X    side->tmporder->rept = n;
X    side->tmporder->p.dir = d;
X    finish_teach(side);
X}
X
X/* Order to follow a unit just needs the unit to follow. */
X
Xorder_follow(unit, leader, n)
XUnit *unit, *leader;
Xint n;
X{
X    unit->orders.type = FOLLOW;
X    unit->orders.rept = n;
X    unit->orders.p.leader = leader;
X}
X
Xcache_follow(side, leader, n)
XSide *side;
XUnit *leader;
Xint n;
X{
X    side->tmporder->type = FOLLOW;
X    side->tmporder->rept = n;
X    side->tmporder->p.leader = leader;
X    finish_teach(side);
X}
X
X/* A two-waypoint patrol suffices for many purposes. */
X/* Should have a more general patrol routine eventually (> 2 waypoints). */
X
Xorder_patrol(unit, x0, y0, x1, y1, n)
XUnit *unit;
Xint x0, y0, x1, y1, n;
X{
X    unit->orders.type = PATROL;
X    unit->orders.rept = n;
X    unit->orders.p.pt[0].x = x0;
X    unit->orders.p.pt[0].y = y0;
X    unit->orders.p.pt[1].x = x1;
X    unit->orders.p.pt[1].y = y1;
X}
X
Xcache_patrol(side, x0, y0, x1, y1, n)
XSide *side;
Xint x0, y0, x1, y1, n;
X{
X    side->tmporder->type = PATROL;
X    side->tmporder->rept = n;
X    side->tmporder->p.pt[0].x = x0;
X    side->tmporder->p.pt[0].y = y0;
X    side->tmporder->p.pt[1].x = x1;
X    side->tmporder->p.pt[1].y = y1;
X    finish_teach(side);
X}
X
X/* Switch from standing order teaching mode back to normal, and confirm */
X/* that the standing order has been set. */
X
Xfinish_teach(side)
XSide *side;
X{
X    Unit *occ;
X
X    side->teach = FALSE;
X    side->sounit->standing->orders[side->soutype] = side->tmporder;
X    notify(side, "%s has orders for %s to %s.",
X	   unit_handle(side, side->sounit), utypes[side->soutype].name,
X	   order_desig(side->tmporder));
X    for_all_occupants(side->sounit, occ) {
X	if (occ->type == side->soutype) {
X	    copy_orders(&(occ->orders), side->tmporder);
X	}
X    }
X    show_timemode(side);
X}
X
X/* Display orders in some coherent fashion.  Use the information about the */
X/* types of order parameters to decide how to display them. */
X
Xchar *
Xorder_desig(orders)
XOrder *orders;
X{
X    switch (orderargs[orders->type]) {
X    case NOARG:
X	sprintf(oargbuf, "");
X	break;
X    case DIR:
X	sprintf(oargbuf, "%s ", dirnames[orders->p.dir]);
X	break;
X    case POS:
X	sprintf(oargbuf, "%d,%d ", orders->p.pt[0].x, orders->p.pt[0].y);
X	break;
X    case LEADER:
X	sprintf(oargbuf, "%s ", unit_handle(NULL, orders->p.leader));
X	break;
X    case WAYPOINTS:
X	sprintf(oargbuf, "%d,%d %d,%d ",
X		orders->p.pt[0].x, orders->p.pt[0].y,
X		orders->p.pt[1].x, orders->p.pt[1].y);
X	break;
X    default:
X	case_panic("order arg type", orderargs[orders->type]);
X    }
X    if (orders->rept > 1)
X	sprintf(orderbuf, "%s %s(%d)",
X		ordernames[orders->type], oargbuf, orders->rept);
X    else
X	sprintf(orderbuf, "%s %s",
X		ordernames[orders->type], oargbuf);
X    return orderbuf;
X}
X
X/* Yeah yeah, assignment statements supposedly copy structures. */
X
Xcopy_orders(dst, src)
XOrder *dst, *src;
X{
X    dst->type = src->type;
X    dst->rept = src->rept;
X    dst->flags = src->flags;
X    switch (orderargs[src->type]) {
X    case NOARG:
X	break;
X    case DIR:
X	dst->p.dir = src->p.dir;
X	break;
X    case POS:
X	dst->p.pt[0].x = src->p.pt[0].x;
X	dst->p.pt[0].y = src->p.pt[0].y;
X	break;
X    case LEADER:
X	/* ??? */
X	break;
X    case WAYPOINTS:	
X	dst->p.pt[0].x = src->p.pt[0].x;
X	dst->p.pt[0].y = src->p.pt[0].y;
X	dst->p.pt[1].x = src->p.pt[1].x;
X	dst->p.pt[1].y = src->p.pt[1].y;
X	break;
X    default:
X	case_panic("order arg type", orderargs[src->type]);
X    }
X}
END_OF_order.c
if test 6140 -ne `wc -c <order.c`; then
    echo shar: \"order.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f output.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"output.c\"
else
echo shar: Extracting \"output.c\" \(14740 characters\)
sed "s/^X//" >output.c <<'END_OF_output.c'
X/* Copyright (c) 1987, 1988  Stanley T. Shebs, University of Utah. */
X/* This program may be used, copied, modified, and redistributed freely */
X/* for noncommercial purposes, so long as this notice remains intact. */
X
X/* RCS $Header: output.c,v 1.1 88/06/21 12:30:32 shebs Exp $ */
X
X/* This file concentrates on the more textual parts of the interface, mainly */
X/* the windows dedicated to messages and the like. */
X
X#include "config.h"
X#include "misc.h"
X#include "period.h"
X#include "side.h"
X#include "unit.h"
X#include "map.h"
X#include "global.h"
X
Xextern int giventime;           /* used here to decide if chess clock in use */
X
Xchar *modenames[] = MODENAMES;  /* names of the modes */
Xchar tmpnbuf[BUFSIZE];          /* tmp buf for notices only. */
X
X/* Variables for the "window printf" utility. */
X
Xbool wprintmode;		/* true when printing is going into a file */
X
Xchar wbuf[BUFSIZE];             /* accumulated line of text */
X
Xint wline;                      /* current position of output */
X
XFILE *wfp;                      /* file pointer for wprintf */
X
X/* Send a message to everybody who's got a screen. */
X
X/*VARARGS*/
Xnotify_all(control, a1, a2, a3, a4, a5, a6)
Xchar *control, *a1, *a2, *a3, *a4, *a5, *a6;
X{
X    Side *side;
X
X    for_all_sides(side) notify(side, control, a1, a2, a3, a4, a5, a6);
X}
X
X/* Main message-sending routine - does its own formatting and spits out to */
X/* the given side.  Scrolling is by copying strings... :-( */
X
X/*VARARGS*/
Xnotify(side, control, a1, a2, a3, a4, a5, a6)
XSide *side;
Xchar *control, *a1, *a2, *a3, *a4, *a5, *a6;
X{
X    int i;
X
X    if (active_display(side)) {
X	for (i = side->nh-1; i > 0; --i) {
X	    strcpy(side->noticebuf[i], side->noticebuf[i-1]);
X	}
X	sprintf(tmpnbuf, control, a1, a2, a3, a4, a5, a6);
X	if (islower(tmpnbuf[0])) tmpnbuf[0] = toupper(tmpnbuf[0]);
X	sprintf(side->noticebuf[0], "%d: %s", global.time, tmpnbuf);
X	show_note(side);
X	flush_output(side);
X	if (Debug) printf("%s\n", side->noticebuf[0]);
X    }
X}
X
X/* Notice area refresher.  All notes except the most recent one are grayed */
X/* out (no effect for monochrome). */
X
Xshow_note(side)
XSide *side;
X{
X    int i, sy = 0;
X
X    if (active_display(side)) {
X	clear_window(side, side->msg);
X	for (i = side->nh-1; i >= 0; --i) {
X	    draw_text(side, side->msg, side->margin, sy, side->noticebuf[i],
X		      ((i == 0) ? side->fgcolor : side->graycolor));
X	    sy += side->fh;
X	}
X    }
X}
X
X/* Info about a unit is complicated by the overriding requirement that it */
X/* be quickly graspable.  Graphics is helpful, so is fixed format (trains */
X/* eyes to get a value of interest from same place each time). */
X
X/* Verbal description of what you can see in your view.  Can't always show */
X/* names because the view doesn't store them, and the unit at that spot may */
X/* not exist anymore.  Units that are "always seen" (like cities) can be */
X/* described in more detail, however. */
X
Xshow_info(side)
XSide *side;
X{
X    bool more = (Debug || Build);
X    int view, u;
X    Unit *unit = side->curunit, *realunit;
X    Side *side2;
X
X    if (active_display(side)) {
X	if (side->curx >= 0 && side->cury >= 0) {
X	    view = side_view(side, side->curx, side->cury);
X	    realunit = unit_at(side->curx, side->cury);
X	    put_on_screen(side, side->curx, side->cury);
X	    if (unit != NULL) {
X		sprintf(tmpbuf, "%s", unit_handle(side, unit));
X		more = TRUE;
X	    } else {
X		if (view == EMPTY || view == UNSEEN) {
X		    sprintf(tmpbuf, "");
X		} else {
X		    side2 = side_n(vside(view));
X		    u = vtype(view);
X		    if ((utypes[u].seealways || more) && realunit != NULL) {
X			sprintf(tmpbuf, "%s", unit_handle(side, realunit));
X		    } else {
X			sprintf(tmpbuf, "%s %s",
X				(side2 == NULL ? "neutral" : side2->name),
X				utypes[u].name);
X		    }
X		}
X	    }
X	    draw_fg_text(side, side->info, side->margin, 0, tmpbuf);
X	    /* put here so overwrites any spillover from name writing */
X	    if (more) {
X		if (unit == NULL) unit = realunit;
X		if (unit != NULL) show_intimate_details(side, unit);
X	    }
X	}
X    }
X}
X
X/* Display all the details that only the owner or God (== debugger) sees. */
X
Xshow_intimate_details(side, unit)
XSide *side;
XUnit *unit;
X{
X    int i, u = unit->type, r, nums[MAXUTYPES], xpos, p = unit->product;
X    Unit *occ;
X
X    if (unit->transport != NULL) {
X	sprintf(spbuf, "In %s", short_unit_handle(unit->transport));
X	draw_fg_text(side, side->info, side->margin, 1*side->fh, spbuf);
X    }
X    if (unit->occupant != NULL) {
X	strcpy(spbuf, "Occ ");
X	for_all_unit_types(i) nums[i] = 0;
X	for_all_occupants(unit, occ) nums[occ->type]++;
X	for_all_unit_types(i) {
X	    if (nums[i] > 0) {
X		sprintf(tmpbuf, "%d %c  ", nums[i], utypes[i].uchar);
X		strcat(spbuf, tmpbuf);
X	    }
X	}
X	draw_fg_text(side, side->info, side->margin, 2*side->fh, spbuf);
X    }
X    sprintf(spbuf, "%s %s Moves %d",
X	    order_desig(&(unit->orders)), (unit->standing != NULL ? "*" : ""),
X	    unit->movesleft);
X    draw_fg_text(side, side->info, side->margin, 3*side->fh, spbuf);
X    if (side->graphical && bar_graphs(side)) {
X	xpos = 0;
X	draw_graph(side, xpos++, unit->hp,
X		   utypes[u].hp, utypes[u].crippled, "HP");
X	if (utypes[u].maxquality > 0)
X	    draw_graph(side, xpos++, unit->quality,
X		       utypes[u].maxquality, 0,"Qual");
X	if (utypes[u].maxmorale > 0)
X	    draw_graph(side, xpos++, unit->morale,
X		       utypes[u].maxmorale, 0, "Mrle");
X	if (producing(unit)) {
X	    draw_graph(side, xpos++, unit->schedule,
X		       utypes[u].make[p], 0, utypes[p].name);
X	}
X	for_all_resource_types (r) {
X	    if (utypes[u].storage[r] > 0) {
X		draw_graph(side, xpos++, unit->supply[r],
X			   utypes[u].storage[r], utypes[u].storage[r]/2,
X			   rtypes[r].name);
X	    }
X	}
X    } else {
X	sprintf(spbuf, "HP %d/%d", unit->hp, utypes[u].hp);
X	if (utypes[u].maxquality > 0) {
X	    sprintf(tmpbuf, "   Quality %d/%d",
X		    unit->quality, utypes[u].maxquality);
X	    strcat(spbuf, tmpbuf);
X	}
X	if (utypes[u].maxmorale > 0) {
X	    sprintf(tmpbuf, "   Morale %d/%d",
X		    unit->morale, utypes[u].maxmorale);
X	    strcat(spbuf, tmpbuf);
X	}
X	draw_fg_text(side, side->info, side->margin+30*side->fw, 0, spbuf);
X	if (producing(unit)) {
X	    sprintf(spbuf, "New %s in %d turns",
X		    utypes[p].name, unit->schedule);
X	    draw_fg_text(side, side->info,
X			 side->margin+30*side->fw, 1*side->fh, spbuf);
X	}
X	sprintf(spbuf, "");
X	for_all_resource_types(r) {
X	    if (utypes[u].storage[r] > 0) {
X		sprintf(tmpbuf, "%s %d/%d  ",
X			rtypes[r].name, unit->supply[r], utypes[u].storage[r]);
X		strcat(spbuf, tmpbuf);
X	    }
X	}
X	draw_fg_text(side, side->info,
X		     side->margin+30*side->fw, 3*side->fh, spbuf);
X    }
X}
X
X/* Erase the info window.  This is done frequently so worthless stuff isn't */
X/* hanging around, such as during someone else's turn. */
X
Xclear_info(side)
XSide *side;
X{
X    if (active_display(side)) {
X	clear_window(side, side->info);
X    }
X}
X
X/* The prompt window consists of exactly one line, but we have to keep track */
X/* of where the blank space begins, for when people type into it. */
X
Xshow_prompt(side)
XSide *side;
X{
X    if (active_display(side)) {
X	clear_window(side, side->prompt);
X	draw_fg_text(side, side->prompt, side->margin, 0, side->promptbuf);
X    }
X}
X
X/* Spit a char onto the prompt line, hopefully after the previous one. */
X
Xecho_at_prompt(side, ch)
XSide *side;
Xchar ch;
X{
X    char tmp[2];
X
X    if (active_display(side)) {
X	sprintf(tmp, "%c", ch);
X	draw_fg_text(side, side->prompt,
X		     side->reqcurstr * side->fw + side->margin, 0, tmp);
X	flush_output(side);
X    }
X}
X
X/* Spit a cursor onto the prompt line. */
X
Xwrite_str_cursor(side)
XSide *side;
X{
X    char tmp[3];
X
X    if (active_display(side)) {
X	sprintf(tmp, "_ ");
X	draw_fg_text(side, side->prompt,
X		     side->reqcurstr * side->fw + side->margin, 0, tmp);
X	flush_output(side);
X    }
X}
X
X/* Clear the prompt line. */
X
Xclear_prompt(side)
XSide *side;
X{
X    if (active_display(side)) {
X	clear_window(side, side->prompt);
X	sprintf(side->promptbuf, " ");
X    }
X}
X
X/* Show a list of all sides in action, drawing a line through any that have */
X/* lost out.  This has to be called for each side if everybody's list is */
X/* to be updated. */
X
X/* Highlight the side whose turn it is, using reverse video for current */
X/* player's own display (to wake she/he/it up) and white instead of gray */
X/* for everybody else.  Also add a star for the benefit of monochrome. */
X
Xshow_all_sides(side)
XSide *side;
X{
X    int sx = side->margin + 2 * side->fw, sy = 0;
X    Side *side2;
X
X    if (active_display(side)) {
X	clear_window(side, side->sides);
X	for_all_sides(side2) {
X	    sprintf(spbuf, " %d", side_number(side2));
X	    draw_text(side, side->sides, side->margin, sy, spbuf,
X		      side_color(side, side2));
X	    sprintf(tmpbuf, "");
X	    if (side2->host != NULL) sprintf(tmpbuf, "(%s)", side2->host);
X	    sprintf(spbuf, ": The %s %s", plural_form(side2->name), tmpbuf);
X	    draw_text(side, side->sides, sx, sy, spbuf,
X		      (side == side2 ? side->fgcolor : side->graycolor));
X	    if (side2->lost) draw_scratchout(side, sy + side->fh / 2);
X	    sy += side->fh;
X	}
X    }
X    update_sides(side);
X}
X
X/* The side color here reflects ally/neutral/enemy status. */
X
Xside_color(side, side2)
XSide *side, *side2;
X{
X    if (side == side2 || allied_side(side, side2)) return side->altcolor;
X    if (enemy_side(side, side2)) return side->enemycolor;
X    return side->neutcolor;
X}
X
X/* This is to pass the current turn marker around. */
X/* (Can this be made more efficient if only one turn marker at a time? */
X/* How to know which one to erase?) */
X
Xupdate_sides(side)
XSide *side;
X{
X    int sx = side->margin, sy = 0;
X    Side *side2;
X
X    if (active_display(side)) {
X	for_all_sides(side2) {
X	    if (!side2->lost) {
X		draw_text(side, side->sides, sx, sy, 
X			  ((side2 == curside) ? "*" : " "),
X			  (side == side2 ? side->fgcolor : side->graycolor));
X	    }
X	    sy += side->fh;
X	}
X	flush_output(side);
X    }
X}
X
X/* Update the turn number and game mode display.  The mode is inverted */
X/* so will stand out (it governs what player input will be accepted, so */
X/* quite important). */
X
Xshow_timemode(side)
XSide *side;
X{
X    if (active_display(side)) {
X	clear_window(side, side->timemode);
X	sprintf(spbuf, "Turn%4d", global.time);
X	draw_fg_text(side, side->timemode, side->margin, 0, spbuf);
X	sprintf(spbuf, "%s%s",
X		modenames[side->mode],
X		(side->teach ? "*" : (Build ? "B" : " ")));
X	draw_text(side, side->timemode, side->margin, side->fh, spbuf,
X		  (side == curside ? side->bgcolor : side->fgcolor));
X	flush_output(side);
X    }
X}
X
X/* The state display summarizes all the units and any other global info. */
X
Xshow_state(side)
XSide *side;
X{
X    int u;
X
X    if (active_display(side)) {
X	clear_window(side, side->state);
X	draw_unit_list(side, side->bvec);
X	for_all_unit_types(u) update_state(side, u);
X    }
X}
X
X/* Alter the numbers for a single type of unit.  Should be called right */
X/* after any changes.  Formatted to look nice, but kind of messy to set */
X/* up correctly - Cobol isn't all bad! */
X
Xupdate_state(side, u)
XSide *side;
Xint u;
X{
X    int ypos;
X
X    if (active_display(side)) {
X	sprintf(spbuf, "");
X	if (side->units[u] > 0)	
X	    sprintf(tmpbuf, "%3d", side->units[u]);
X	else
X	    sprintf(tmpbuf, "   ");
X	strcat(spbuf, tmpbuf);
X	if (side->building[u] > 0) {
X	    strcat(spbuf, "(");
X	    sprintf(tmpbuf, "%d", side->building[u]);
X	    strcat(spbuf, tmpbuf);
X	    strcat(spbuf, ")");
X	}
X	sprintf(tmpbuf, "               ");
X	strcat(spbuf, tmpbuf);
X	if (total_gain(side, u) > 0) {
X	    sprintf(tmpbuf, "%4d", total_gain(side, u));
X	    sprintf(spbuf+8, "%s", tmpbuf);
X	}
X	sprintf(tmpbuf, "               ");
X	strcat(spbuf, tmpbuf);
X	if (total_loss(side, u) > 0) {
X	    sprintf(tmpbuf, "- %d", total_loss(side, u));
X	    sprintf(spbuf+13, "%s", tmpbuf);
X	}
X	ypos = u * max(side->hh, side->fh) + (side->hh-side->fh) / 2;
X	draw_fg_text(side, side->state, side->hw+side->margin, ypos, spbuf);
X    }
X}
X
X/* Would be faster to stash these, but enough difference to care? */
X
Xtotal_gain(side, u)
XSide *side;
Xint u;
X{
X    int i, total = 0;
X
X    for (i = 0; i < DUMMYREAS; ++i) total += side->balance[u][i];
X    return total;
X}
X
Xtotal_loss(side, u)
XSide *side;
Xint u;
X{
X    int i, total = 0;
X
X    for (i = DUMMYREAS+1; i < NUMREASONS; ++i) total += side->balance[u][i];
X    return total;
X}
X
X/* To get the traditional digital clock display, we need fixed-format digit */
X/* printing.  There will *never* be an option for analog display... */
X
Xshow_clock(side)
XSide *side;
X{
X    int time = side->timeleft, hour, minute, second;
X
X    hour = time / 3600;  minute = (time / 60) % 60;  second = time % 60;
X    if (active_display(side) && giventime > 0) {
X	clear_window(side, side->clock);
X	sprintf(spbuf, "%s%d:%s%d:%s%d",
X		(hour < 10 ? "0" : ""), hour,
X		(minute < 10 ? "0" : ""), minute,
X		(second < 10 ? "0" : ""), second);
X	draw_fg_text(side, side->clock, 0, 0, spbuf);
X    }
X}
X
X/* Updates to clock need to be sure that display changes immediately. */
X
Xupdate_clock(side)
XSide *side;
X{
X    show_clock(side);
X    flush_output(side);
X}
X
X/* Dump a file into the help window.  This routine is neither sophisticated */
X/* nor robust - lines must be short enough and file must be one page. */
X/* Returns success or failure of file opening. */
X
Xshow_file(side, fname)
XSide *side;
Xchar *fname;
X{
X    FILE *fp;
X
X    if ((fp = fopen(fname, "r")) != NULL) {
X	while (fgets(spbuf, BUFSIZE, fp)) {
X	    spbuf[strlen(spbuf)-1] = '\0';  /* cut off newline */
X	    wprintf(side, spbuf);
X	}
X	fclose(fp);
X	return TRUE;
X    } else {
X	return FALSE;
X    }
X}
X
X/* Init our counters or open a file. */
X
Xinit_wprintf(side, fname)
XSide *side;
Xchar *fname;
X{
X    wline = 0;
X    if (fname != NULL) {
X	wprintmode = TRUE;
X	wfp = fopen(fname, "w");
X	if (wfp == NULL) {
X	    notify(side, "Warning: open failed.");
X	}
X    } else {
X	wprintmode = FALSE;
X	clear_window(side, side->help);
X    }
X}
X
X/* Make like printf, but to the help window.  This is pretty crude - has an */
X/* automatic newlining (mis)feature, and doesn't do anything about long */
X/* lines, but it's good enough. */
X
X/*VARARGS*/
Xwprintf(side, control, a1, a2, a3, a4, a5, a6)
XSide *side;
Xchar *control, *a1, *a2, *a3, *a4, *a5, *a6;
X{
X    if (active_display(side)) {
X	sprintf(wbuf, control, a1, a2, a3, a4, a5, a6);
X	if (wprintmode && wfp != NULL) {
X	    fprintf(wfp, "%s\n", wbuf);
X	} else {
X	    if (strlen(wbuf) > 0) {
X		draw_fg_text(side, side->help, side->margin, wline*side->fh, wbuf);
X	    }
X	    wline++;
X	}
X    }
X}
X
X/* If we were actually printing to a file, close it down. */
X
Xfinish_wprintf()
X{
X    if (wprintmode && wfp != NULL) fclose(wfp);
X}
X
X/* Frequently-called routine to draw text in the foreground color. */
X
Xdraw_fg_text(side, win, x, y, str)
XSide *side;
Xint win, x, y;
Xchar *str;
X{
X    draw_text(side, win, x, y, str, side->fgcolor);
X}
END_OF_output.c
if test 14740 -ne `wc -c <output.c`; then
    echo shar: \"output.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 12 \(of 18\).
cp /dev/null ark12isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 18 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0