home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
116.STATISTC.INC
< prev
next >
Wrap
Text File
|
1992-07-12
|
1KB
|
37 lines
procedure StellarDispersion;
const
maxDispersion = 29;
var
s : sectorindex;
disperse : array [0..maxDIspersion] of integer;
average : longint;
total,
temp,
lost : integer;
begin
write( 'Stellar Dispersion from what ');
s := GetSector;
if s = 0 then exit;
TwoWayDistances( s, distances, true, true );
for temp := 0 to maxDispersion do
disperse[ temp ] := 0;
lost := 0;
for s := 1 to maxSector do
if distances[s].d < maxint then
disperse[ distances[ s ].d ] := disperse[ distances[ s ].d ] + 1
else if space.sectors[s].number > 0 then { visited, but not connected?}
lost := lost + 1;
average := 0;
total := 0;
for temp := 0 to maxDispersion do
begin
average := average + temp * disperse[ temp ];
total := total + disperse[ temp ];
write( disperse[ temp ] : 5 );
if temp mod 10 = 9 then
writeln;
end;
writeln('There are ', lost, ' unreachable sectors, ', total, ' reachable sectors.');
writeln('Average distance to (known) sectors: ', average / total : 2 : 2);
end;