b260d7f4cc82a11dc7a3cf3c53b4fd8e0d3aa340
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)misc.c 5.1 (Berkeley) %G%";
# define _tty cur_term->Nttyb
* @(#)misc.c 1.2 (Berkeley) 3/28/83
mvprintw(ERR_Y
, ERR_X
, str
, arg
);
while ((c
= readch()) == '\n' || c
== '\r' || c
== ' ')
if (c
== killchar() || c
== erasechar())
case '1': case '2': case '3':
case '4': case '5': case '6':
case '0': case 'P': case 'p':
while ((c1
=readch()) != '\r' && c1
!= '\n' && c1
!= ' ')
else if (c1
== erasechar()) {
if (getyn(EXTENSIONPROMPT
)) {
for (safe
= 0, i
= 0; i
< NUMSAFE
; i
++)
if (pp
->safety
[i
] != S_UNKNOWN
)
if (op
->mileage
== 0 || onecard(op
)
|| (op
->can_go
&& op
->mileage
>= 500))
for (miles
= 0, i
= 0; i
< NUMSAFE
; i
++)
if (op
->safety
[i
] != S_PLAYED
&& pp
->safety
[i
] == S_UNKNOWN
)
if (miles
+ safe
== NUMSAFE
)
for (miles
= 0, i
= 0; i
< HAND_SZ
; i
++)
if ((safe
= pp
->hand
[i
]) <= C_200
)
if (miles
+ (Topcard
- Deck
) * 3 > 1000)
* Get a yes or no answer to the given question. Saves are
* also allowed. Return TRUE if the answer was yes, FALSE if no.
* Check to see if more games are desired. If not, and game
* came from a saved file, make sure that they don't want to restore
* it. Exit appropriately.
if (Player
[PLAYER
].total
>= 5000 || Player
[COMP
].total
>= 5000)
if (getyn(ANOTHERGAMEPROMPT
))
* must do accounting normally done in main()
if (Player
[PLAYER
].total
> Player
[COMP
].total
)
else if (Player
[PLAYER
].total
< Player
[COMP
].total
)
Player
[PLAYER
].total
= 0;
if (getyn(ANOTHERHANDPROMPT
))
if (!Saved
&& getyn(SAVEGAMEPROMPT
))
for (cnt
= 0; read(0, &c
, 1) <= 0; cnt
++)
static int ioctl_args
= FREAD
;
(void) ioctl(fileno(stdin
), TIOCFLUSH
, &ioctl_args
);