X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=2ef4261a62f2183f1c05532379de791cd272fc8a;hb=2a0411c349010501abd2f907b8965a8ca9b4e80c;hp=af932a0dbcb000c7e1e3ba7f260ece91f3cda2bc;hpb=942f187b68be75931f4bd35015d74d284ef802c4;p=super-star-trek.git diff --git a/sst.c b/sst.c index af932a0..2ef4261 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("%.2f", future[i]-game.state.date); chew(); proutn(" ?"); key = scan();