Stas's change to get rid of unwanted EOLs.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 14 Apr 2005 14:11:10 +0000 (14:11 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 14 Apr 2005 14:11:10 +0000 (14:11 +0000)
TODO
io.c
reports.c
setup.c
sst.c

diff --git a/TODO b/TODO
index ee7251f6ec0dbc0ea05a599591e2edb6de8e9ecf..69139fff0ceb8c0712499e447368723c530a4a77 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,4 +5,4 @@
   non-"super" version Matuszek and Reynolds wrote.)
 
 * Code to hurl you out of quadrant if a supernova occurs as you warp in 
   non-"super" version Matuszek and Reynolds wrote.)
 
 * Code to hurl you out of quadrant if a supernova occurs as you warp in 
-  seems to hang.
+  seems to hang.  One bad case is when you get stopped by a star.
diff --git a/io.c b/io.c
index d34184206dda81290214e4fbd52f0bd0b06046a9..fd50f61ab570bd2dfaf4eb925f390197981f1db9 100644 (file)
--- a/io.c
+++ b/io.c
@@ -121,7 +121,7 @@ void skip(int i)
 {
     while (i-- > 0) {
        if (game.options & OPTION_CURSES) {
 {
     while (i-- > 0) {
        if (game.options & OPTION_CURSES) {
-           proutn("\n\r");
+           proutn("\n");
        } else {
            linecount++;
            if (linecount >= rows)
        } else {
            linecount++;
            if (linecount >= rows)
index f169c150e4ddd5bd192887cccb56f2e575169171..c43732670462480db8fa7eefd7e54104680c0aee 100644 (file)
--- a/reports.c
+++ b/reports.c
@@ -194,11 +194,11 @@ void chart(int nn)
        rechart();
 
     if (lastchart < game.state.date && condit == IHDOCKED) {
        rechart();
 
     if (lastchart < game.state.date && condit == IHDOCKED) {
-       proutn("Spock-  \"I revised the Star Chart from the starbase's records.\"\n");
+       prout("Spock-  \"I revised the Star Chart from the starbase's records.\"");
        rechart();
     }
 
        rechart();
     }
 
-    if (nn == 0) proutn("       STAR CHART FOR THE KNOWN GALAXY\n");
+    if (nn == 0) prout("       STAR CHART FOR THE KNOWN GALAXY");
     if (game.state.date > lastchart)
        prout("(Last surveillance update %d stardates ago).",
              (int)(game.state.date-lastchart));
     if (game.state.date > lastchart)
        prout("(Last surveillance update %d stardates ago).",
              (int)(game.state.date-lastchart));
@@ -226,9 +226,8 @@ void chart(int nn)
                proutn(" ");
        }
        proutn("  |");
                proutn(" ");
        }
        proutn("  |");
-       if (i<GALSIZE) proutn("\n");
+       if (i<GALSIZE) skip(1);
     }
     }
-    prout(""); /* flush output */
 }
 
 static void sectscan(int goodScan, int i, int j) 
 }
 
 static void sectscan(int goodScan, int i, int j) 
@@ -384,7 +383,7 @@ int srscan(int l)
        }
        if (rightside)
            status(jj);
        }
        if (rightside)
            status(jj);
-       if (i<sizeof(requests)/sizeof(requests[0])) proutn("\n");
+       if (i<sizeof(requests)/sizeof(requests[0])) skip(1);
        if (req!=0) return(goodScan);
     }
     prout("");
        if (req!=0) return(goodScan);
     }
     prout("");
diff --git a/setup.c b/setup.c
index d729c615576ba411ca1d8dd6a0cbd15df19780ab..6ea71b53166729ef5c50e9d40767a06909a24de5 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -264,13 +264,13 @@ void setup(int needprompt)
                if (distq < 6.0*(BASEMAX+1-inbase) && Rand() < 0.75) {
                    contflag = TRUE;
 #ifdef DEBUG
                if (distq < 6.0*(BASEMAX+1-inbase) && Rand() < 0.75) {
                    contflag = TRUE;
 #ifdef DEBUG
-                   proutn("DEBUG: Abandoning base #%d at %d-%d\n", i, ix, iy);
+                   prout("DEBUG: Abandoning base #%d at %d-%d", i, ix, iy);
 #endif
                    break;
                }
 #ifdef DEBUG
                else if (distq < 6.0 * (BASEMAX+1-inbase)) {
 #endif
                    break;
                }
 #ifdef DEBUG
                else if (distq < 6.0 * (BASEMAX+1-inbase)) {
-                   proutn("DEBUG: saving base #%d, close to #%d\n", i, j);
+                   prout("DEBUG: saving base #%d, close to #%d", i, j);
                }
 #endif
            }
                }
 #endif
            }
@@ -290,7 +290,9 @@ void setup(int needprompt)
        int klump = (1.0 - r*r)*klumper;
        if (klump > krem) klump = krem;
        krem -= klump;
        int klump = (1.0 - r*r)*klumper;
        if (klump > krem) klump = krem;
        krem -= klump;
-       do iran(GALSIZE,&ix,&iy); while (game.state.galaxy[ix][iy].supernova);
+       do iran(GALSIZE,&ix,&iy);
+       while (game.state.galaxy[ix][iy].supernova ||
+               game.state.galaxy[ix][iy].klingons + klump > 9);
        game.state.galaxy[ix][iy].klingons += klump;
     } while (krem > 0);
     // Position Klingon Commander Ships
        game.state.galaxy[ix][iy].klingons += klump;
     } while (krem > 0);
     // Position Klingon Commander Ships
diff --git a/sst.c b/sst.c
index 2d454cbace8a96052649698ced7137770730ec8d..1d4ca2feb1d55d33a9e89a00d7a43326c0828f26 100644 (file)
--- a/sst.c
+++ b/sst.c
@@ -82,7 +82,7 @@ Here are Stas Sergeev's changes:
       chasing SCom can take an eternity).
 
    5. Probe target you enter is now the destination quadrant. Before I don't 
       chasing SCom can take an eternity).
 
    5. Probe target you enter is now the destination quadrant. Before I don't 
-      remember what it was, but it was something I had difficulty using)
+      remember what it was, but it was something I had difficulty using.
 
    6. Secret password is now autogenerated.
 
 
    6. Secret password is now autogenerated.
 
@@ -797,5 +797,10 @@ void debugme(void)
        }
        chew();
     }
        }
        chew();
     }
+    proutn("Induce supernova here? ");
+    if (ja() != 0) {
+       game.state.galaxy[quadx][quady].supernova = TRUE;
+       atover(1);
+    }
 }
 #endif
 }
 #endif