class Page:
def __init__(self):
self.stars = None
- self.starbase = None
+ self.starbase = False
self.klingons = None
+ def __repr__(self):
+ return "<%s,%s,%s>" % (self.klingons, self.starbase, self.stars)
def fill2d(size, fillfun):
"Fill an empty list in 2D."
game.state.baseq = filter(lambda x: x != game.quadrant, game.state.baseq)
game.quad[w.i][w.j] = '.'
game.base.invalidate()
- game.state.galaxy[game.quadrant.i][game.quadrant.j].starbase -= 1
- game.state.chart[game.quadrant.i][game.quadrant.j].starbase -= 1
+ game.state.galaxy[game.quadrant.i][game.quadrant.j].starbase = False
+ game.state.chart[game.quadrant.i][game.quadrant.j].starbase = False
game.state.basekl += 1
newcnd()
return None
game.instar = 0
for i in range(GALSIZE):
for j in range(GALSIZE):
- k = randrange(1, QUADSIZE**2/10+1)
+ k = randrange(1, QUADSIZE**2/10)
game.instar += k
game.state.galaxy[i][j].stars = k
# Locate star bases in galaxy
+ if game.idebug:
+ prout("=== Allocating %d bases" % game.inbase)
for i in range(game.inbase):
while True:
while True:
prout("=== Saving base #%d, close to #%d" % (i, j))
if not contflag:
break
+ if game.idebug:
+ prout("=== Placing base #%d in quadrant %s" % (i, w))
game.state.baseq.append(w)
game.state.galaxy[w.i][w.j].starbase = game.state.chart[w.i][w.j].starbase = True
# Position ordinary Klingon Battle Cruisers
+++ /dev/null
-sst2k: seed set to 1329859817
-
-
--SUPER- STAR TREK
-
-Would you like a regular, tournament, or saved game? # recorded by esr@snark on Tue Feb 21 16:30:17 2012
-# Ends with a torpedo miss
-r
-Would you like a Short, Medium, or Long game? s
-Are you a Novice, Fair, Good, Expert, or Emeritus player? n
-Choose your game style (plain, almy, fancy or just press enter):
-
-
-It is stardate 2279. The Federation is being attacked by
-a deadly Klingon invasion force. As captain of the United
-Starship U.S.S. Enterprise, it is your mission to seek out
-and destroy this invasion force of 4 battle cruisers.
-You have an initial allotment of 7 stardates to complete
-your mission. As you proceed you may be given more time.
-
-You will have 4 supporting starbases.
-Starbase locations- 5 - 2 1 - 7 2 - 2 8 - 2
-
-The Enterprise is currently in Quadrant 1 - 5 Sector 5 - 8
-
-Good Luck!
-COMMAND>
-COMMAND> move aut 2 8 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 2 - 8.
-COMMAND>
-COMMAND> move aut 4 7 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 4 - 7.
-COMMAND>
-COMMAND> mov aut 6 1
-
-COMMAND>
-COMMAND> move aut 5 6 2 2
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 5 - 6.
-
-130 unit hit on the Enterprise from Klingon at Sector 8 - 10
-
-
-Energy left 4178 shields down 100%, torpedoes left 10
-COMMAND> phasers
-
-Manual or automatic? aut
-Phasers locked on target. Energy available: 4043.35
-180 units required. Units to fire= 300
-
-157 unit hit on Klingon at Sector 8 - 10
-***Klingon at Sector 8 - 10 destroyed.
-COMMAND>
-COMMAND> move aut 6 1
-
-COMMAND>
-COMMAND> move aut 7 7 1 1
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 7 - 7.
-COMMAND>
-COMMAND> move aut 8 4 1 1
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 8 - 4.
-COMMAND>
-COMMAND> move aut 7 3 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 7 - 3.
-
-162 unit hit on the Enterprise from Klingon at Sector 4 - 7
-
-177 unit hit on the Enterprise from Klingon at Sector 4 - 4
-
-
-Energy left 2731 shields down 100%, torpedoes left 10
-COMMAND> torp 2
-Target sector for torpedo number 1- 4 4
-Target sector for torpedo number 2- 4 7
-
-Track for torpedo number 1- 4 - 4
-***Klingon at Sector 4 - 4 destroyed.
-
-Track for torpedo number 2- 4 - 6 4 - 7
-***Klingon at Sector 4 - 7 destroyed.
-COMMAND>
-COMMAND>
-COMMAND> move aut 4 4 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-[ANNOUNCEMENT ARRIVING...]
-
-***Enterprise caught in long range tractor beam--
-Enterprise is pulled to Quadrant 5 - 4, Sector 2 - 3
-Shields raised.
-
-Enemy attack reduces shield strength to 79%, torpedoes left 8
-COMMAND>
-COMMAND> torp
-8 torpedoes left.
-Number of torpedoes to fire- 2
-Target sector for torpedo number 1- 6 4
-Target sector for torpedo number 2- 6 4
-
-Track for torpedo number 1- 3 - 3 4 - 3 5 - 4
-6 - 4
-***Commander at Sector 6 - 4 damaged-- displaced by blast to Sector 3 - 2
-
-Track for torpedo number 2- 3 - 3 4 - 3 5 - 4
-6 - 4 7 - 4 8 - 4 9 - 5 10 - 5
-Torpedo missed.
-
-34 unit hit on the Enterprise from Klingon at Sector 3 - 2
-
-
-Energy left 2315 shields up 75%, torpedoes left 6
-COMMAND> quit
-
-May the Great Bird of the Galaxy roost upon your home planet.
+++ /dev/null
-# seed 1329859817
-# options
-# recorded by esr@snark on Tue Feb 21 16:30:17 2012
-# Ends with a torpedo miss
-r
-s
-n
-
-
-move aut 2 8 5 5
-
-move aut 4 7 5 5
-
-mov aut 6 1
-
-move aut 5 6 2 2
-phasers
-aut
-300
-
-move aut 6 1
-
-move aut 7 7 1 1
-
-move aut 8 4 1 1
-
-move aut 7 3 5 5
-torp 2
-4 4
-4 7
-
-
-move aut 4 4 5 5
-
-torp
-2
-6 4
-6 4
-quit
[ANNOUNCEMENT ARRIVING...]
Message from Starfleet Command Stardate 2698.43
- Supernova in Quadrant 6 - 6; caution advised.
+ Supernova in Quadrant 4 - 2; caution advised.
+
+[ANNOUNCEMENT ARRIVING...]
+
+Message from Starfleet Command Stardate 2698.75
+ Supernova in Quadrant 4 - 3; caution advised.
COMMAND>
COMMAND> move 5 8 10 1
(Manual movement assumed.)
+++ /dev/null
-sst2k: seed set to 1329874855
-
-
--SUPER- STAR TREK
-
-Would you like a regular, tournament, or saved game? # SST2K version 2.1
-# recorded by esr@snark on Tue Feb 21 20:40:55 2012
-# Tests docking and movement blockage by starbases
-r
-Would you like a Short, Medium, or Long game? s
-Are you a Novice, Fair, Good, Expert, or Emeritus player? n
-Choose your game style (plain, almy, fancy or just press enter):
-
-
-It is stardate 2328. The Federation is being attacked by
-a deadly Klingon invasion force. As captain of the United
-Starship U.S.S. Enterprise, it is your mission to seek out
-and destroy this invasion force of 5 battle cruisers.
-You have an initial allotment of 7 stardates to complete
-your mission. As you proceed you may be given more time.
-
-You will have 2 supporting starbases.
-Starbase locations- 3 - 1 4 - 2
-
-The Enterprise is currently in Quadrant 5 - 5 Sector 8 - 3
-
-Good Luck!
-COMMAND>
-COMMAND> move aut 8 1
-
-COMMAND>
-COMMAND> mov aut 7 2 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 7 - 2.
-
-[ANNOUNCEMENT ARRIVING...]
-
-Message from Starfleet Command Stardate 2329.35
- Supernova in Quadrant 6 - 5; caution advised.
-COMMAND>
-COMMAND> mov aut 6 2 8 8
-
-Ensign Chekov- "Course laid in, Captain."
-
-Enterprise blocked by object at 3 - 6;
-Emergency stop required 125 units of energy.
-Collision detected
-COMMAND>
-COMMAND> move aut 6 2 8 8
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 6 - 2.
-
-253 unit hit on the Enterprise from Klingon at Sector 9 - 9
-
-169 unit hit on the Enterprise from Klingon at Sector 5 - 10
-
-
-Energy left 3943 shields down 100%, torpedoes left 10
-COMMAND> mov aut 8 1
-
-
-86 unit hit on the Enterprise from Klingon at Sector 9 - 9
-
-87 unit hit on the Enterprise from Klingon at Sector 5 - 10
-
-
-Energy left 3686 shields down 100%, torpedoes left 10
-COMMAND> torp 2
-Target sector for torpedo number 1- 9 9
-Target sector for torpedo number 2- 5 10
-
-Track for torpedo number 1- 8 - 2 8 - 3 8 - 4
-8 - 5 8 - 6 9 - 7 9 - 8 9 - 9
-***Klingon at Sector 9 - 9 destroyed.
-
-Track for torpedo number 2- 8 - 2 7 - 3 7 - 4
-7 - 5 6 - 6 6 - 7 6 - 8 5 - 9
-5 - 10
-***Klingon at Sector 5 - 10 destroyed.
-COMMAND>
-COMMAND> move aut 1 1
-
-
-[ANNOUNCEMENT ARRIVING...]
-
-Message from Starfleet Command Stardate 2331.31
- Supernova in Quadrant 6 - 3; caution advised.
-COMMAND>
-COMMAND> move aut 2 2 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 2 - 2.
-COMMAND>
-COMMAND> move aut 4 2 5 5
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 4 - 2.
-
-[ANNOUNCEMENT ARRIVING...]
-
-Message from Starfleet Command Stardate 2333.51
- Supernova in Quadrant 1 - 8; caution advised.
-COMMAND>
-COMMAND> move aut 7 5
-
-COMMAND>
-COMMAND> move aut 8 5
-
-
-Enterprise blocked by object at 8 - 5;
-Emergency stop required 125 units of energy.
-Collision detected
-COMMAND> ?
-LEGAL COMMANDS ARE:
-SRSCAN STATUS REQUEST LRSCAN
-PHASERS TORPEDO PHOTONS MOVE SHIELDS
-DOCK DAMAGES CHART IMPULSE REST
-WARP SCORE SENSORS ORBIT TRANSPORT
-MINE CRYSTALS SHUTTLE PLANETS REPORT
-COMPUTER COMMANDS EMEXIT PROBE SAVE
-FREEZE ABANDON DESTRUCT DEATHRAY DEBUG
-MAYDAY SOS CALL QUIT HELP
-
-COMMAND> dock
-Docked.
-COMMAND>
-COMMAND> move aut 2 5 4 4
-
-Ensign Chekov- "Course laid in, Captain."
-
-Entering Quadrant 2 - 5.
-
-[ANNOUNCEMENT ARRIVING...]
-
-Message from Starfleet Command Stardate 2334.46
- Supernova in Quadrant 3 - 7; caution advised.
-COMMAND>
-COMMAND> move aut 10 10
-
-COMMAND>
-COMMAND> move aut 4 6 1 1
-
-Ensign Chekov- "Course laid in, Captain."
-
-First Officer Spock- "Captain, I compute that such
- a trip would require approximately 124 percent of our
- remaining time. Are you sure this is wise?" no
-Please answer with "y" or "n": n
-COMMAND>
-COMMAND> quit
-
-May the Great Bird of the Galaxy roost upon your home planet.
+++ /dev/null
-# seed 1329874855
-# options
-# SST2K version 2.1
-# recorded by esr@snark on Tue Feb 21 20:40:55 2012
-# Tests docking and movement blockage by starbases
-r
-s
-n
-
-
-move aut 8 1
-
-mov aut 7 2 5 5
-
-mov aut 6 2 8 8
-
-move aut 6 2 8 8
-mov aut 8 1
-torp 2
-9 9
-5 10
-
-move aut 1 1
-
-move aut 2 2 5 5
-
-move aut 4 2 5 5
-
-move aut 7 5
-
-move aut 8 5
-?
-dock
-
-move aut 2 5 4 4
-
-move aut 10 10
-
-move aut 4 6 1 1
-no
-n
-
-quit
-n