From: Eric S. Raymond Date: Mon, 27 Feb 2017 16:58:10 +0000 (-0500) Subject: Restore m m .1 fix and fix a broken test. X-Git-Tag: 2.2~19 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5a0430f3474264a2502c767b1d05a9177e518b7c;p=super-star-trek.git Restore m m .1 fix and fix a broken test. --- diff --git a/sst.py b/sst.py index db33c54..ccb1f14 100755 --- a/sst.py +++ b/sst.py @@ -4013,15 +4013,20 @@ def getcourse(isprobe): iprompt = True key = scanner.nexttok() itemp = "verbose" - if key != "IHREAL": + if key == "IHREAL": + delta.j = scanner.real + else: huh() raise TrekError - delta.j = scanner.real key = scanner.nexttok() - if key != "IHREAL": + if key == "IHREAL": + delta.i = scanner.real + elif key == "IHEOL": + delta.i = 0 + scanner.push("\n") + else: huh() raise TrekError - delta.i = scanner.real # Check for zero movement if delta.i == 0 and delta.j == 0: scanner.chew() diff --git a/test/test1.chk b/test/test1.chk index a104152..7cdda72 100644 --- a/test/test1.chk +++ b/test/test1.chk @@ -1,76 +1,46 @@ -sst2k: seed set to 1329758601 +sst2k: seed set to 1488214474 -SUPER- STAR TREK -Would you like a regular, tournament, or saved game? # recorded by esr@snark on Mon Feb 20 12:23:21 2012 -# Tests auto torpedo fire -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 3054. 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 3 battle cruisers. -You have an initial allotment of 7 stardates to complete -your mission. As you proceed you may be given more time. +Stardate 2761. -You will have 5 supporting starbases. -Starbase locations- 1 - 7 3 - 8 3 - 1 5 - 8 2 - 2 +21 Klingons. +An unknown number of Romulans. +And one (GULP) Super-Commander. +7 stardates. +3 starbases in 7 - 2 2 - 4 6 - 8 -The Enterprise is currently in Quadrant 6 - 7 Sector 8 - 8 +The Enterprise is currently in Quadrant 1 - 3 Sector 3 - 8 Good Luck! -COMMAND> -COMMAND> m 8 -(Manual movement assumed.) - -Beg your pardon, Captain? -COMMAND> move 8 7 3 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. - -[ANNOUNCEMENT ARRIVING...] - -***Enterprise caught in long range tractor beam-- -Enterprise is pulled to Quadrant 4 - 4, Sector 9 - 8 -Shields raised. - -32 unit hit on the Enterprise from Klingon at Sector 4 - 10 - -21 unit hit on the Enterprise from Klingon at Sector 1 - 5 - - -Energy left 4090 shields up 71%, torpedoes left 10 + YOU'LL NEED IT. +COMMAND> # SST2K version 2.1 +# Tests automatic torpedo fire +# recorded by esr@snark on Mon Feb 27 11:54:34 2017 +torp +10 torpedoes left. +Number of torpedoes to fire- 5 +Maximum of 3 torpedoes per burst. COMMAND> torp 10 torpedoes left. Number of torpedoes to fire- 3 -Target sector for torpedo number 1- 1 5 -Target sector for torpedo number 2- 4 10 -Target sector for torpedo number 3- 7 9 - -Track for torpedo number 1- 8 - 8 7 - 7 6 - 7 -5 - 6 4 - 6 3 - 6 2 - 5 1 - 5 -***Klingon at Sector 1 - 5 destroyed. - -Track for torpedo number 2- 8 - 8 7 - 9 -***Commander at Sector 7 - 9 damaged-- displaced by blast to Sector 8 - 9 +Target sector for torpedo number 1- 4 8 +Target sector for torpedo number 2- 2 6 +Target sector for torpedo number 3- 6 5 -Track for torpedo number 3- 8 - 9 -***Commander at Sector 8 - 9 destroyed. +Track for torpedo number 1- 4 - 8 +***Klingon at Sector 4 - 8 destroyed. -34 unit hit on the Enterprise from Klingon at Sector 4 - 10 +Track for torpedo number 2- 3 - 7 2 - 6 +***Klingon at Sector 2 - 6 destroyed. +Track for torpedo number 3- 4 - 7 5 - 6 6 - 5 +***Klingon at Sector 6 - 5 destroyed. -Energy left 4056 shields up 68%, torpedoes left 7 -COMMAND> QUIT +Enemy attack reduces shield strength to 92%, torpedoes left 7 +COMMAND> quit May the Great Bird of the Galaxy roost upon your home planet. diff --git a/test/test1.log b/test/test1.log index 6a59854..6f46ccc 100644 --- a/test/test1.log +++ b/test/test1.log @@ -1,17 +1,14 @@ -# seed 1329758601 -# options -# recorded by esr@snark on Mon Feb 20 12:23:21 2012 -# Tests auto torpedo fire -r -s -n - - -m 8 -move 8 7 3 2 +# seed 1488214474 +# options regular short good fancy +# SST2K version 2.1 +# Tests automatic torpedo fire +# recorded by esr@snark on Mon Feb 27 11:54:34 2017 +torp +5 torp 3 -1 5 -4 10 -7 9 -QUIT +4 8 +2 6 +6 5 +quit +n