From: Eric S. Raymond Date: Wed, 22 Feb 2012 08:17:53 +0000 (-0500) Subject: Cleanup after the phantom-base-bug fix. X-Git-Tag: 2.2~82 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5781766e894157bbffe397c4ee3ca5a44d8c5a83;p=super-star-trek.git Cleanup after the phantom-base-bug fix. --- diff --git a/sst.py b/sst.py index b3264ee..e2bf5c3 100755 --- a/sst.py +++ b/sst.py @@ -5437,7 +5437,9 @@ def setup(): game.instar = 0 for i in range(GALSIZE): for j in range(GALSIZE): - k = randrange(1, QUADSIZE**2/10) + # Can't have more stars per quadrant than fit in one decimal digit, + # if we do the chart representation will break. + k = randrange(1, min(10, QUADSIZE**2/10)) game.instar += k game.state.galaxy[i][j].stars = k # Locate star bases in galaxy diff --git a/test/test3.chk b/test/test3.chk new file mode 100644 index 0000000..26f0d73 --- /dev/null +++ b/test/test3.chk @@ -0,0 +1,114 @@ +sst2k: seed set to 1329869600 + + +-SUPER- STAR TREK + +Would you like a regular, tournament, or saved game? # SST2K version 2.1 +# recorded by esr@snark on Tue Feb 21 19:13:20 2012 +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 2693. 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 3 supporting starbases. +Starbase locations- 5 - 5 7 - 5 3 - 2 + +The Enterprise is currently in Quadrant 7 - 3 Sector 7 - 7 + +Good Luck! +COMMAND> +COMMAND> move aut 4 1 + +COMMAND> +COMMAND> move aut 7 1 5 5 + +Ensign Chekov- "Course laid in, Captain." + +[ANNOUNCEMENT ARRIVING...] + +***Enterprise caught in long range tractor beam-- +Enterprise is pulled to Quadrant 2 - 8, Sector 4 - 8 +Shields raised. + +33 unit hit on the Enterprise from Klingon at Sector 7 - 4 + + +Energy left 4764 shields up 78%, torpedoes left 10 +COMMAND> torp 2 +Target sector for torpedo number 1- 7 4 +Target sector for torpedo number 2- 7 5 + +Track for torpedo number 1- 5 - 7 6 - 6 6 - 5 +7 - 4 +***Klingon at Sector 7 - 4 destroyed. + +Track for torpedo number 2- 5 - 7 6 - 6 7 - 5 +***Commander at Sector 7 - 5 damaged-- displaced by blast to Sector 5 - 8 + +66 unit hit on the Enterprise from Klingon at Sector 5 - 8 + + +Energy left 4697 shields up 70%, torpedoes left 8 +COMMAND> phasers + +Weapons Officer Sulu- "High-speed shield control enabled, sir." +Manual or automatic? a +Phasers locked on target. Energy available: 4497.40 +159 units required. Units to fire= 300 + +Shields lowered. + +155 unit hit on Commander at Sector 5 - 8 +***Commander at Sector 5 - 8 destroyed. + +Shields raised. +COMMAND> +COMMAND> m 7 7 5 5 +(Manual movement assumed.) + +Helmsman Sulu- "Aye, Sir." + +YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER +AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS, +YOU WILL BE DESTROYED. +COMMAND> +COMMAND> m 2 5 2 2 +(Manual movement assumed.) + +Helmsman Sulu- "Aye, Sir." + +YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER +AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS, +YOU WILL BE DESTROYED. + +Entering Quadrant 4 - 7. + +[ANNOUNCEMENT ARRIVING...] + +Message from Starfleet Command Stardate 2698.43 + 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.) + +Helmsman Sulu- "Aye, Sir." + +Engineering to bridge-- +We don't have enough energy, but we could do it at warp 4, +if you'll lower the shields. +COMMAND> quit + +May the Great Bird of the Galaxy roost upon your home planet. diff --git a/test/test3.log b/test/test3.log new file mode 100644 index 0000000..292c39b --- /dev/null +++ b/test/test3.log @@ -0,0 +1,25 @@ +# seed 1329869600 +# options +# SST2K version 2.1 +# recorded by esr@snark on Tue Feb 21 19:13:20 2012 +r +s +n + + +move aut 4 1 + +move aut 7 1 5 5 +torp 2 +7 4 +7 5 +phasers +a +300 + +m 7 7 5 5 + +m 2 5 2 2 + +move 5 8 10 1 +quit diff --git a/test/test4.chk b/test/test4.chk deleted file mode 100644 index 26f0d73..0000000 --- a/test/test4.chk +++ /dev/null @@ -1,114 +0,0 @@ -sst2k: seed set to 1329869600 - - --SUPER- STAR TREK - -Would you like a regular, tournament, or saved game? # SST2K version 2.1 -# recorded by esr@snark on Tue Feb 21 19:13:20 2012 -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 2693. 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 3 supporting starbases. -Starbase locations- 5 - 5 7 - 5 3 - 2 - -The Enterprise is currently in Quadrant 7 - 3 Sector 7 - 7 - -Good Luck! -COMMAND> -COMMAND> move aut 4 1 - -COMMAND> -COMMAND> move aut 7 1 5 5 - -Ensign Chekov- "Course laid in, Captain." - -[ANNOUNCEMENT ARRIVING...] - -***Enterprise caught in long range tractor beam-- -Enterprise is pulled to Quadrant 2 - 8, Sector 4 - 8 -Shields raised. - -33 unit hit on the Enterprise from Klingon at Sector 7 - 4 - - -Energy left 4764 shields up 78%, torpedoes left 10 -COMMAND> torp 2 -Target sector for torpedo number 1- 7 4 -Target sector for torpedo number 2- 7 5 - -Track for torpedo number 1- 5 - 7 6 - 6 6 - 5 -7 - 4 -***Klingon at Sector 7 - 4 destroyed. - -Track for torpedo number 2- 5 - 7 6 - 6 7 - 5 -***Commander at Sector 7 - 5 damaged-- displaced by blast to Sector 5 - 8 - -66 unit hit on the Enterprise from Klingon at Sector 5 - 8 - - -Energy left 4697 shields up 70%, torpedoes left 8 -COMMAND> phasers - -Weapons Officer Sulu- "High-speed shield control enabled, sir." -Manual or automatic? a -Phasers locked on target. Energy available: 4497.40 -159 units required. Units to fire= 300 - -Shields lowered. - -155 unit hit on Commander at Sector 5 - 8 -***Commander at Sector 5 - 8 destroyed. - -Shields raised. -COMMAND> -COMMAND> m 7 7 5 5 -(Manual movement assumed.) - -Helmsman Sulu- "Aye, Sir." - -YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER -AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS, -YOU WILL BE DESTROYED. -COMMAND> -COMMAND> m 2 5 2 2 -(Manual movement assumed.) - -Helmsman Sulu- "Aye, Sir." - -YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER -AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS, -YOU WILL BE DESTROYED. - -Entering Quadrant 4 - 7. - -[ANNOUNCEMENT ARRIVING...] - -Message from Starfleet Command Stardate 2698.43 - 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.) - -Helmsman Sulu- "Aye, Sir." - -Engineering to bridge-- -We don't have enough energy, but we could do it at warp 4, -if you'll lower the shields. -COMMAND> quit - -May the Great Bird of the Galaxy roost upon your home planet. diff --git a/test/test4.log b/test/test4.log deleted file mode 100644 index 292c39b..0000000 --- a/test/test4.log +++ /dev/null @@ -1,25 +0,0 @@ -# seed 1329869600 -# options -# SST2K version 2.1 -# recorded by esr@snark on Tue Feb 21 19:13:20 2012 -r -s -n - - -move aut 4 1 - -move aut 7 1 5 5 -torp 2 -7 4 -7 5 -phasers -a -300 - -m 7 7 5 5 - -m 2 5 2 2 - -move 5 8 10 1 -quit