From 62136f2a7ac42053bf1d5a6312d0cbc7038c15b8 Mon Sep 17 00:00:00 2001 From: Ken Arnold Date: Sun, 1 May 1983 20:26:17 -0800 Subject: [PATCH] swap the board and the cards on the screen SCCS-vsn: games/cribbage/crib.c 1.13 SCCS-vsn: games/cribbage/io.c 1.7 SCCS-vsn: games/cribbage/support.c 1.10 SCCS-vsn: games/cribbage/cribcur.h 1.2 --- usr/src/games/cribbage/crib.c | 10 +++++----- usr/src/games/cribbage/cribcur.h | 21 +++++++++++---------- usr/src/games/cribbage/io.c | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/usr/src/games/cribbage/crib.c b/usr/src/games/cribbage/crib.c index 0cc719bc86..e6d9f285e0 100644 --- a/usr/src/games/cribbage/crib.c +++ b/usr/src/games/cribbage/crib.c @@ -53,9 +53,9 @@ char *argv[]; signal(SIGINT, bye); crmode(); noecho(); - Playwin = subwin(stdscr, PLAY_Y, PLAY_X, 0, 0); - Tablewin = subwin(stdscr, TABLE_Y, TABLE_X, 0, PLAY_X); - Compwin = subwin(stdscr, COMP_Y, COMP_X, 0, TABLE_X + PLAY_X); + Playwin = subwin(stdscr, PLAY_Y, PLAY_X, 0, SCORE_SZ); + Tablewin = subwin(stdscr, TABLE_Y, TABLE_X, 0, PLAY_X + SCORE_SZ); + Compwin = subwin(stdscr, COMP_Y, COMP_X, 0, TABLE_X + PLAY_X + SCORE_SZ); leaveok(Playwin, TRUE); leaveok(Tablewin, TRUE); leaveok(Compwin, TRUE); @@ -246,7 +246,7 @@ BOOLEAN mycrib; werase(Compwin); wrefresh(Compwin); - move(CRIB_Y, 0); + move(CRIB_Y, SCORE_SZ); clrtobot(); mvaddstr(LINES - 1, 0, Msgbuf); @@ -376,7 +376,7 @@ BOOLEAN mycrib, blank; if (mycrib) cardx = CRIB_X; else - cardx = 0; + cardx = SCORE_SZ; mvaddstr(CRIB_Y, cardx + 1, "CRIB"); prcard(stdscr, CRIB_Y + 1, cardx, turnover, blank); diff --git a/usr/src/games/cribbage/cribcur.h b/usr/src/games/cribbage/cribcur.h index c2cb39bc79..8b8b6bbcd9 100644 --- a/usr/src/games/cribbage/cribcur.h +++ b/usr/src/games/cribbage/cribcur.h @@ -1,13 +1,14 @@ -# define PLAY_Y 15 /* starting pos for player's hand window */ -# define PLAY_X 12 -# define TABLE_Y 21 /* starting pos for table window */ -# define TABLE_X 14 -# define COMP_Y 15 /* starting pos for computer's hand window */ -# define COMP_X 12 -# define SCORE_Y 0 /* starting pos for scoring board */ -# define SCORE_X 39 -# define CRIB_Y 17 /* position of crib (cut card) */ -# define CRIB_X (PLAY_X + TABLE_X) +# define PLAY_Y 15 /* size of player's hand window */ +# define PLAY_X 12 +# define TABLE_Y 21 /* size of table window */ +# define TABLE_X 14 +# define COMP_Y 15 /* size of computer's hand window */ +# define COMP_X 12 +# define SCORE_Y 0 /* starting position of scoring board */ +# define SCORE_X 0 +# define SCORE_SZ 41 /* X size of score board */ +# define CRIB_Y 17 /* position of crib (cut card) */ +# define CRIB_X (PLAY_X + TABLE_X + SCORE_SZ) # define PEG '*' /* what a peg looks like on the board */ diff --git a/usr/src/games/cribbage/io.c b/usr/src/games/cribbage/io.c index 316fa3b933..0c564cce82 100644 --- a/usr/src/games/cribbage/io.c +++ b/usr/src/games/cribbage/io.c @@ -325,7 +325,7 @@ char *prompt; * msg: * Display a message at the top of the screen. */ -char Msgbuf[BUFSIZ] = ""; +char Msgbuf[BUFSIZ] = { '\0' }; int Mpos = 0; -- 2.20.1