|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 2076 (0x81c)
Types: TextFile
Names: »show.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Nobs/show.c«
#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);
}