* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)lrscan.c 5.2 (Berkeley) %G%";
** LONG RANGE OF SCANNERS
** A summary of the quadrants that surround you is printed. The
** hundreds digit is the number of Klingons in the quadrant,
** the tens digit is the number of starbases, and the units digit
** is the number of stars. If the printout is "///" it means
** that that quadrant is rendered uninhabitable by a supernova.
** It also updates the "scanned" field of the quadrants it scans,
** for future use by the "chart" option of the computer.
printf("Long range scan for quadrant %d,%d\n\n", Ship
.quadx
, Ship
.quady
);
/* print the header on top */
for (j
= Ship
.quady
- 1; j
<= Ship
.quady
+ 1; j
++)
if (j
< 0 || j
>= NQUADS
)
for (i
= Ship
.quadx
- 1; i
<= Ship
.quadx
+ 1; i
++)
printf("\n -------------------\n");
if (i
< 0 || i
>= NQUADS
)
/* negative energy barrier */
printf(" ! * ! * ! * !");
/* print the left hand margin */
for (j
= Ship
.quady
- 1; j
<= Ship
.quady
+ 1; j
++)
if (j
< 0 || j
>= NQUADS
)
/* negative energy barrier again */
q
->scanned
= q
->klings
* 100 + q
->bases
* 10 + q
->stars
;
printf(" %3d !", q
->scanned
);
printf("\n -------------------\n");