X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=653e06be826b8a71d4950682fa2ad04fb78f1267;hb=21d59740dd2e1cca6b54be441129fb1a72edfe2d;hp=af932a0dbcb000c7e1e3ba7f260ece91f3cda2bc;hpb=942f187b68be75931f4bd35015d74d284ef802c4;p=super-star-trek.git diff --git a/sst.c b/sst.c index af932a0..653e06b 100644 --- a/sst.c +++ b/sst.c @@ -408,17 +408,20 @@ void cramen(int i) { proutn(s); } -void cramlc(int key, int x, int y) { - if (key == 1) proutn(" Quadrant"); - else if (key == 2) proutn(" Sector"); - proutn(" %d - %d", x, y); +char *cramlc(enum loctype key, int x, int y) { + static char buf[32]; + buf[0] = '\0'; + if (key == quadrant) strcpy(buf, "Quadrant "); + else if (key == sector) strcpy(buf, "Sector "); + sprintf(buf+strlen(buf), "%d-%d", x, y); + return buf; } void crmena(int i, int enemy, int key, int x, int y) { if (i == 1) proutn("***"); cramen(enemy); proutn(" at"); - cramlc(key, x, y); + proutn(cramlc(key, x, y)); } void crmshp(void) { @@ -528,12 +531,6 @@ int ja(void) { } } -void cramf(double x, int w, int d) { - char buf[64]; - sprintf(buf, "%*.*f", w, d, x); - proutn(buf); -} - double square(double i) { return i*i; } static void clearscreen(void) { @@ -680,7 +677,7 @@ void debugme(void) { case FSCMOVE: proutn("SC Move "); break; case FSCDBAS: proutn("SC Base Destroy "); break; } - cramf(future[i]-game.state.date, 8, 2); + proutn("%82.2f", future[i]-game.state.date); chew(); proutn(" ?"); key = scan();