bool silent_yes()
{
- bool outcome;
+ bool outcome = false;
for (;;) {
char* reply = get_input();
exit(EXIT_SUCCESS);
// LCOV_EXCL_STOP
}
+ if (strlen(reply) == 0) {
+ free(reply);
+ rspeak(PLEASE_ANSWER);
+ continue;
+ }
char* firstword = (char*) xmalloc(strlen(reply) + 1);
sscanf(reply, "%s", firstword);
/* Print message X, wait for yes/no answer. If yes, print Y and return true;
* if no, print Z and return false. */
{
- bool outcome;
+ bool outcome = false;
for (;;) {
speak(question);
// LCOV_EXCL_STOP
}
+ if (strlen(reply) == 0) {
+ free(reply);
+ rspeak(PLEASE_ANSWER);
+ continue;
+ }
+
char* firstword = (char*) xmalloc(strlen(reply) + 1);
sscanf(reply, "%s", firstword);
Welcome to Adventure!! Would you like instructions?
+>
+
+Please answer the question.
+
+Welcome to Adventure!! Would you like instructions?
+
> y
Somewhere nearby is Colossal Cave, where others have found fortunes in