}
}
- turn = 0;
+ turn = boatsfound = 0;
revealed = FALSE;
dohilite = TRUE;
}
return(hilite | LIFEBOAT);
else if (revealed && (state & S_LIFEBOAT))
return(hilite | HIDDEN);
- else if ((state & S_MARKED))
- return(hilite | MARKED);
else if ((state & S_BLANKED))
return(hilite | BLANKED);
else if ((state & S_PROBED))
return(hilite | ('0' + probes[i][j]));
+ else if ((state & S_MARKED))
+ return(hilite | MARKED);
else
return(hilite | UNKNOWN);
}
return(FALSE);
}
-static int sgetc(s)
-/* get a character, restricted to a string */
-char *s;
+static int confirm(void)
{
- char *s1;
int ch;
(void)refresh();
ch = toupper(ch);
if (ch == CTRLC)
outro();
- for (s1=s; *s1 && ch != *s1; ++s1)
- continue;
- if (*s1)
+ if (ch == 'N' || ch == 'Y')
{
(void) addch((chtype)ch);
(void)refresh();
- return(ch);
+ return(ch == 'Y');
}
}
}
redisplay(FALSE); /* force found count to be updated */
prompt("Want to play again [yn]? ");
} while
- (toupper(sgetc("YN")) == 'Y');
+ (confirm());
outro();
/*NOTREACHED*/
}