Add CURSES command.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 28 Feb 2017 15:11:24 +0000 (10:11 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 28 Feb 2017 15:11:24 +0000 (10:11 -0500)
doc/sst-doc.xml
sst.py
test/test4.chk
test/test5.chk
test/test5.log

index a5f73ad9a1599f201aa4190729059a95c814bd3d..cb1858fc9551ba128df76d7f1a77adb7fb34c894 100644 (file)
@@ -1490,6 +1490,17 @@ Full command:  HELP &lt;command&gt;
 <para>This command reads the appropriate section from the SST.DOC file,
 providing the file is in the current directory.</para>
 
 <para>This command reads the appropriate section from the SST.DOC file,
 providing the file is in the current directory.</para>
 
+</sect1>
+<sect1><title>Curses switch</title>
+
+<literallayout>
+Mnemonic:  CURSES
+Full command:  CURSES
+</literallayout>
+
+<para>Switch from tty to curses interface. Mainly useful for
+debugging, when continuing a replayed game.</para>
+
 </sect1>
 </chapter>
 <chapter><title>Miscellaneous Notes</title>
 </sect1>
 </chapter>
 <chapter><title>Miscellaneous Notes</title>
@@ -1645,7 +1656,8 @@ orientation</quote>.</para>
  ST        STATUS                                 (none)
  T         TRANSPORT                              transporter
  W         WARP &lt;FACTOR&gt;                          (none)
  ST        STATUS                                 (none)
  T         TRANSPORT                              transporter
  W         WARP &lt;FACTOR&gt;                          (none)
-
+ CU        CURSES                                 (none)
  L. R. Scan:   thousands digit:   supernova
                hundreds digit:    Klingons
                tens digit:        starbases
  L. R. Scan:   thousands digit:   supernova
                hundreds digit:    Klingons
                tens digit:        starbases
diff --git a/sst.py b/sst.py
index a9aa1a4b53e005fb82d0c95dd3bd8cd8fd7bd0f8..3b00bd6dc994c64f2e2a94443f6e1c448ab4ace8 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -6161,6 +6161,7 @@ commands = [
     ("QUIT",             0),
     ("HELP",             0),
     ("SCORE",            0),
     ("QUIT",             0),
     ("HELP",             0),
     ("SCORE",            0),
+    ("CURSES",            0),
     ("",                 0),
 ]
 
     ("",                 0),
 ]
 
@@ -6381,6 +6382,9 @@ def makemoves():
             helpme()                        # get help
         elif cmd == "SCORE":
             score()                         # see current score
             helpme()                        # get help
         elif cmd == "SCORE":
             score()                         # see current score
+        elif cmd == "CURSES":
+            game.options |= (OPTION_CURSES | OPTION_COLOR)
+            iostart()
         while True:
             if game.alldone:
                 break                # Game has ended
         while True:
             if game.alldone:
                 break                # Game has ended
index 133e85eac860c42ac504f38fc0fe37b3658ef062..e3cfdd5bf1c6dcf4eb95478f8c2cdec5cb035bfc 100644 (file)
@@ -115,7 +115,7 @@ CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
+HELP         SCORE        CURSES                    
 COMMAND> 
 COMMAND> warp 7
 Engineer Scott- "Aye, but our maximum safe speed is warp 6."
 COMMAND> 
 COMMAND> warp 7
 Engineer Scott- "Aye, but our maximum safe speed is warp 6."
@@ -137,14 +137,14 @@ CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
+HELP         SCORE        CURSES                    
 COMMAND> 
 COMMAND> move aut 5 8 5 5
 
 Ensign Chekov- "Course laid in, Captain."
 
 First Officer Spock- "Captain, I compute that such
 COMMAND> 
 COMMAND> move aut 5 8 5 5
 
 Ensign Chekov- "Course laid in, Captain."
 
 First Officer Spock- "Captain, I compute that such
-  a trip would require approximately 151 percent of our
+  a trip would require approximately 135 percent of our
   remaining time.  Are you sure this is wise?" n
 COMMAND> move aut 9 9
 
   remaining time.  Are you sure this is wise?" n
 COMMAND> move aut 9 9
 
@@ -158,7 +158,7 @@ CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
+HELP         SCORE        CURSES                    
 COMMAND> n
 LEGAL COMMANDS ARE:
 SRSCAN       STATUS       REQUEST      LRSCAN       
 COMMAND> n
 LEGAL COMMANDS ARE:
 SRSCAN       STATUS       REQUEST      LRSCAN       
@@ -169,13 +169,13 @@ CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
+HELP         SCORE        CURSES                    
 COMMAND> move aut 5  8 5 5
 
 Ensign Chekov- "Course laid in, Captain."
 
 First Officer Spock- "Captain, I compute that such
 COMMAND> move aut 5  8 5 5
 
 Ensign Chekov- "Course laid in, Captain."
 
 First Officer Spock- "Captain, I compute that such
-  a trip would require approximately 168 percent of our
+  a trip would require approximately 145 percent of our
   remaining time.  Are you sure this is wise?" y
 
 Entering Quadrant 5 - 8.
   remaining time.  Are you sure this is wise?" y
 
 Entering Quadrant 5 - 8.
index c47db12d661514c0e490c55485ee3cd7fc7bd4d5..f3ed6cec00e3946dbeec530a15cb4a76dce85a21 100644 (file)
@@ -220,7 +220,7 @@ CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
 COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
 ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
 DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
+HELP         SCORE        CURSES                    
 COMMAND> 
 COMMAND> move aut 6 7 2 2
 
 COMMAND> 
 COMMAND> move aut 6 7 2 2
 
@@ -237,28 +237,6 @@ Message from Starfleet Command       Stardate 4077.10
 
 Message from Starfleet Command       Stardate 4077.67
      Supernova in Quadrant 5 - 7; caution advised.
 
 Message from Starfleet Command       Stardate 4077.67
      Supernova in Quadrant 5 - 7; caution advised.
-COMMAND> y
-LEGAL COMMANDS ARE:
-SRSCAN       STATUS       REQUEST      LRSCAN       
-PHASERS      TORPEDO      PHOTONS      MOVE         SHIELDS      
-DOCK         DAMAGES      CHART        IMPULSE      REST         
-WARP         SENSORS      ORBIT        TRANSPORT    MINE         
-CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER     
-COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
-ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
-DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
-COMMAND> n
-LEGAL COMMANDS ARE:
-SRSCAN       STATUS       REQUEST      LRSCAN       
-PHASERS      TORPEDO      PHOTONS      MOVE         SHIELDS      
-DOCK         DAMAGES      CHART        IMPULSE      REST         
-WARP         SENSORS      ORBIT        TRANSPORT    MINE         
-CRYSTALS     SHUTTLE      PLANETS      REPORT       COMPUTER     
-COMMANDS     EMEXIT       PROBE        SAVE         FREEZE       
-ABANDON      DESTRUCT     DEATHRAY     CAPTURE      CLOAK        
-DEBUG        MAYDAY       SOS          CALL         QUIT         
-HELP         SCORE                     
 COMMAND> quit
 
 May the Great Bird of the Galaxy roost upon your home planet.
 COMMAND> quit
 
 May the Great Bird of the Galaxy roost upon your home planet.
index 4861ea1ec7228a99b3ce706a2898ea0a7630fb40..cfe40dd430b54880f8b99ed8ef47c273b6a41b6f 100644 (file)
@@ -59,6 +59,4 @@ move aut 8 5 2 2
 n
 
 move aut 6 7 2 2
 n
 
 move aut 6 7 2 2
-y
-n
 quit
 quit