aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-31 06:43:48 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-31 06:43:48 -0500
commit745aa81b83b9cea5468210bf65601fd3a1090787 (patch)
tree1f887257d8c61ecc838e683105e290c9947fe656
parentb400e1273f87c606742d6e897c22729160f8dfda (diff)
downloadtaipan-745aa81b83b9cea5468210bf65601fd3a1090787.tar.gz
remove commented-out cruft, use ATASCII box for final_stats()
-rw-r--r--taipan.c139
1 files changed, 19 insertions, 120 deletions
diff --git a/taipan.c b/taipan.c
index d372ac7..2e57671 100644
--- a/taipan.c
+++ b/taipan.c
@@ -386,79 +386,20 @@ void fancy_numbers(unsigned long num, char *fancy)
if(mil) strcat(fancy, " Million");
}
-/*
-void fancytest(void) {
- fancy_numbers(1000, fancy_num);
- cputs(fancy_num);
- cputs("\r\n");
- fancy_numbers(10000, fancy_num);
- cputs(fancy_num);
- cputs("\r\n");
- fancy_numbers(100000, fancy_num);
- cputs(fancy_num);
- cputs("\r\n");
- fancy_numbers(1000000, fancy_num);
- cputs(fancy_num);
- cputs("\r\n");
- fancy_numbers(4294967295, fancy_num); // LONG_MAX
- cputs(fancy_num);
- cputs("\r\n");
- cgetc();
-}
-*/
-
void fight_stats(int ships, int orders)
{
- // char ch_orders[12];
-
- /*
- if (orders == 0)
- {
- strcpy(ch_orders, "\0");
- } else if (orders == 1) {
- strcpy(ch_orders, "Fight ");
- } else if (orders == 2) {
- strcpy(ch_orders, "Run ");
- } else {
- strcpy(ch_orders, "Throw Cargo");
- }
- */
-
+ cursor(0);
gotoxy(0, 0);
- /*
- if (ships >= 1000)
- {
- printw("%d", ships);
- } else if (ships >= 100) {
- printw(" %d", ships);
- } else if (ships >= 10) {
- printw(" %d", ships);
- } else {
- printw(" %d", ships);
- }
- */
-
if(ships < 1000) cputc(' ');
if(ships < 100) cputc(' ');
if(ships < 10) cputc(' ');
cprintulong(ships);
- // gotoxy(0, 5);
cputs(" ship");
if(ships != 1) cputc('s');
cputs(" attacking, Taipan! \r\n");
- /*
- if (ships == 1)
- {
- printw("ship attacking, Taipan! \n");
- } else {
- printw("ships attacking, Taipan!\n");
- }
- */
-
- // printw("Your orders are to: %s", ch_orders);
cputs("Your orders are to: ");
if(orders == 1)
cputs("Fight ");
@@ -467,16 +408,6 @@ void fight_stats(int ships, int orders)
else if(orders == 3)
cputs("Throw Cargo");
- /*
- move(0, 50);
- printw("| We have");
- move(1, 50);
- printw("| %d guns", guns);
- move(2, 50);
- printw("----------");
- move(16, 0);
- */
-
revers(1);
gotoxy(30, 0);
cputs(" We have");
@@ -1429,6 +1360,7 @@ void mchenry(void)
void retire(void)
{
+ cursor(0);
compradores_report();
revers(1);
cputs(" \r\n");
@@ -1436,7 +1368,7 @@ void retire(void)
cputs(" \r\n");
cputs(" M I L L I O N A I R E ! \r\n");
cputs(" \r\n");
- revers(1);
+ revers(0);
timed_getch(TMOUT_5S);
final_stats();
@@ -1492,8 +1424,12 @@ void final_stats(void)
cputs("\r\n\r\n\r\n");
}
cputs("Your Rating:\r\n");
- cputs(" _______________________________\r\n");
- cputs("|");
+ cputc(17); // upper left corner
+ chline(31);
+ cputc(5); // upper right corner
+ cputs("\r\n");
+ // cputs(" _______________________________\r\n");
+ cputc('|');
if (cash > 49999L)
{
revers(1);
@@ -1501,7 +1437,7 @@ void final_stats(void)
cputs("Ma Tsu");
revers(0);
cputs(" 50,000 and over |\r\n");
- cputs("|");
+ cputc('|');
if ((cash < 50000L) && (cash > 7999L))
{
revers(1);
@@ -1509,7 +1445,7 @@ void final_stats(void)
cputs("Master Taipan");
revers(0);
cputs(" 8,000 to 49,999|\r\n");
- cputs("|");
+ cputc('|');
if ((cash < 8000L) && (cash > 999L))
{
revers(1);
@@ -1517,7 +1453,7 @@ void final_stats(void)
cputs("Taipan");
revers(0);
cputs(" 1,000 to 7,999|\r\n");
- cputs("|");
+ cputc('|');
if ((cash < 1000) && (cash > 499))
{
revers(1);
@@ -1525,7 +1461,7 @@ void final_stats(void)
cputs("Compradore");
revers(0);
cputs(" 500 to 999|\r\n");
- cputs("|");
+ cputc('|');
if (cash < 500)
{
revers(1);
@@ -1533,7 +1469,12 @@ void final_stats(void)
cputs("Galley Hand");
revers(0);
cputs(" less than 500|\r\n");
- cputs("|_______________________________|\r\n\r\n");
+
+ // cputs("|_______________________________|\r\n\r\n");
+
+ cputc(26); // lower left corner
+ chline(31);
+ cputc(3); // lower right corner
while ((choice != 'Y') && (choice != 'y') &&
(choice != 'N') && (choice != 'n'))
@@ -2529,35 +2470,6 @@ void visit_bank(void)
return;
}
-/*
-void debttest() {
- int i;
-
- debt = 1;
-
- for(i=0; i<20; i++) {
- debt = debt + (debt >> 8) + (debt >> 10);
- // debt = debt + (debt >> 4) + (debt >> 5) + (debt >> 7) - (debt >> 9); // debt *= 0.09961
- printf("%lu\n", debt);
- }
-
- cgetc();
- clrscr();
- debt = 1;
-
- for(i=0; i<20; i++) {
- if(debt > 200)
- debt += (debt / 200);
- else
- debt++;
-
- printf("%lu\n", debt);
- }
- cgetc();
-
-}
-*/
-
/* N.B. cc65 is perfectly OK with main(void), and it avoids
warnings about argv/argc unused. */
int main(void) {
@@ -2577,19 +2489,6 @@ int main(void) {
}
#endif
- /*
- _randomize();
- while(1) {
- clrscr();
- cprintulong(randi());
- cputs("\r\n");
- cprintulong(rand());
- cgetc();
- }
- */
-
- // fancytest();
- // debttest();
atari_text_setup();
initrand();
splash_intro();