home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume4
/
nobs2
/
show.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-05-20
|
2KB
|
97 lines
#include "defs.h"
#include "globs.h"
#include "window.h"
char *
cardname(c)
CARD c;
{
static char hold[4];
sprintf(hold, "%2s%s", rankrdr[RANK(c)], suitrdr[SUIT(c)]);
return hold;
}
showhand()
/*
* If a player is human, it's always player 1.
*/
{
int i;
for (i=0; i<6; i++) mvwprintw(Programhand, 0, 5*i, "XXX");
for (i=0; i<6; i++) mvwprintw(Humanhand, 2, 5*i, cardname(hand[1][i]));
mvwprintw(Programhand, 2, 0, "\n");
mvwprintw(Humanhand, 0, 0, "\n");
werase(Cut);
werase(Crib);
werase(Pscore);
werase(Hscore);
werase(Select);
wrefresh(Cut);
wrefresh(Crib);
wrefresh(Pscore);
wrefresh(Hscore);
wrefresh(Select);
wrefresh(Programhand);
wrefresh(Humanhand);
}
showfour()
{
int i;
werase(Humanhand);
for (i=0; i<4; i++) mvwprintw(Humanhand, 2, 5*i, cardname(hand[1][i]));
waddch(Humanhand,'\n');
for (i=2; i<4; i++) mvwprintw(Crib, 0, 5*i, "XXX ");
for (i=0; i<4; i++) mvwaddch(Select, 0, 5*i+2, 'a'+i);
wrefresh(Humanhand);
wrefresh(Crib);
wrefresh(Select);
}
showpplay(who, i, scored)
int who, i, scored;
{
mvwprintw(Programhand, 0, 5*i, " ");
mvwprintw(Programhand, 2, 5*(3-nleft[who]), cardname(hand[who][i]));
if (scored) mvwprintw(Prompt, 0, 0, "%d for %d.\n", count, scored);
else mvwprintw(Prompt, 0, 0, "%d.\n", count);
wrefresh(Programhand);
wrefresh(Prompt);
sleep(2);
}
showhplay(i, scored)
int i, scored;
{
mvwprintw(Humanhand, 2, 5*i, " ");
mvwprintw(Humanhand, 0, 5*(3-nleft[1]), cardname(hand[1][i]));
if (scored) mvwprintw(Prompt, 0, 0, "%d for %d.\n", count, scored);
else mvwprintw(Prompt, 0, 0, "%d.\n", count);
wrefresh(Humanhand);
wrefresh(Prompt);
}
showcut()
{
mvwprintw(Prompt, 0, 0, playertype[dealer]==HUMAN? "I cut:\n":
"You cut:\n");
mvwaddch(Prompt, 1, 0, '\n');
wrefresh(Prompt);
sleep(1);
mvwprintw(Prompt, 1, 0, "the %s of %s\n",
rankname[RANK(cut)], suitname[SUIT(cut)]);
mvwprintw(Cut, 0, 0, cardname(cut));
wrefresh(Prompt);
wrefresh(Cut);
sleep(1);
}
exposecrib()
{
int i;
for (i=0; i<6; i++) mvwprintw(Crib, 0, 5*i, cardname(crib[i]));
wrefresh(Crib);
sleep(1);
}