|
|
1.1 ! root 1: # include "mille.h" ! 2: ! 3: /* ! 4: * @(#)print.c 1.1 (Berkeley) 4/1/82 ! 5: */ ! 6: ! 7: # define COMP_STRT 20 ! 8: # define CARD_STRT 2 ! 9: ! 10: prboard() { ! 11: ! 12: reg PLAY *pp; ! 13: reg int i, j, k, temp; ! 14: ! 15: for (k = 0; k < 2; k++) { ! 16: pp = &Player[k]; ! 17: temp = k * COMP_STRT + CARD_STRT; ! 18: for (i = 0; i < NUM_SAFE; i++) ! 19: if (pp->safety[i] == S_PLAYED) { ! 20: mvaddstr(i, temp, C_name[i + S_CONV]); ! 21: if (pp->coups[i]) ! 22: mvaddch(i, temp - CARD_STRT, '*'); ! 23: } ! 24: mvprintw(14, temp, C_fmt, C_name[pp->battle]); ! 25: mvprintw(16, temp, C_fmt, C_name[pp->speed]); ! 26: for (i = C_25; i <= C_200; ) { ! 27: reg char *name; ! 28: reg int end; ! 29: ! 30: name = C_name[i]; ! 31: temp = k * 40; ! 32: end = pp->nummiles[i++]; ! 33: for (j = 0; j < end; j++) ! 34: mvwaddstr(Miles, i, (j << 2) + temp, name); ! 35: } ! 36: } ! 37: prscore(TRUE); ! 38: temp = CARD_STRT; ! 39: pp = &Player[PLAYER]; ! 40: for (i = 0; i < HAND_SZ; i++) ! 41: mvprintw(i + 6, temp, C_fmt, C_name[pp->hand[i]]); ! 42: mvprintw(6, COMP_STRT + CARD_STRT, "%2d", Topcard - Deck); ! 43: mvprintw(8, COMP_STRT + CARD_STRT, C_fmt, C_name[Discard]); ! 44: if (End == 1000) { ! 45: static char ext[] = "Extension"; ! 46: ! 47: stand(EXT_Y, EXT_X, ext); ! 48: } ! 49: wrefresh(Board); ! 50: wrefresh(Miles); ! 51: wrefresh(Score); ! 52: } ! 53: ! 54: /* ! 55: * Put str at (y,x) in standout mode ! 56: */ ! 57: stand(y, x, str) ! 58: reg int y, x; ! 59: reg char *str; { ! 60: ! 61: standout(); ! 62: mvaddstr(y, x, str); ! 63: standend(); ! 64: return TRUE; ! 65: } ! 66: ! 67: prscore(for_real) ! 68: reg bool for_real; { ! 69: ! 70: reg PLAY *pp; ! 71: reg int x; ! 72: reg char *Score_fmt = "%4d"; ! 73: ! 74: stdscr = Score; ! 75: for (pp = Player; pp < &Player[2]; pp++) { ! 76: x = (pp - Player) * 6 + 21; ! 77: mvprintw(1, x, Score_fmt, pp->mileage); ! 78: mvprintw(2, x, Score_fmt, pp->safescore); ! 79: if (pp->safescore == 400) ! 80: mvaddstr(3, x + 1, "300"); ! 81: else ! 82: mvaddch(3, x + 3, '0'); ! 83: mvprintw(4, x, Score_fmt, pp->coupscore); ! 84: if (Window == W_FULL || Finished) { ! 85: #ifdef EXTRAP ! 86: if (for_real) ! 87: finalscore(pp); ! 88: else ! 89: extrapolate(pp); ! 90: #else ! 91: finalscore(pp); ! 92: #endif ! 93: mvprintw(11, x, Score_fmt, pp->hand_tot); ! 94: mvprintw(13, x, Score_fmt, pp->total); ! 95: mvprintw(14, x, Score_fmt, pp->games); ! 96: } ! 97: else { ! 98: mvprintw(6, x, Score_fmt, pp->hand_tot); ! 99: mvprintw(8, x, Score_fmt, pp->total); ! 100: mvprintw(9, x, Score_fmt, pp->games); ! 101: } ! 102: } ! 103: stdscr = Board; ! 104: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.