Fix for Gitlab issue #65: revisiting "fee fie foe foo" and "fum".

100% coverage, "make oldcompare" passes.
This commit is contained in:
Eric S. Raymond 2023-04-03 09:24:21 -04:00
parent 0a1f5dbb43
commit 2dd1ccc535
3 changed files with 12 additions and 8 deletions

View file

@ -202,10 +202,9 @@ static phase_codes_t bigwords(vocab_t id)
if ((foobar == WORD_EMPTY && id == FEE) || if ((foobar == WORD_EMPTY && id == FEE) ||
(foobar == FEE && id == FIE) || (foobar == FEE && id == FIE) ||
(foobar == FIE && id == FOE) || (foobar == FIE && id == FOE) ||
(foobar == FOE && id == FOO) || (foobar == FOE && id == FOO)) {
(foobar == FOE && id == FUM)) {
game.foobar = id; game.foobar = id;
if ((id != FOO) && (id != FUM)) { if (id != FOO) {
rspeak(OK_MAN); rspeak(OK_MAN);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
@ -214,8 +213,6 @@ static phase_codes_t bigwords(vocab_t id)
(TOTING(EGGS) && game.loc == objects[EGGS].plac)) { (TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
rspeak(NOTHING_HAPPENS); rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} else if (id == FUM) {
goto fum;
} else { } else {
/* Bring back troll if we steal the eggs back from him before /* Bring back troll if we steal the eggs back from him before
* crossing. */ * crossing. */
@ -232,7 +229,6 @@ static phase_codes_t bigwords(vocab_t id)
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
} else { } else {
fum:
rspeak(START_OVER); rspeak(START_OVER);
game.foobar = WORD_EMPTY; game.foobar = WORD_EMPTY;
return GO_CLEAROBJ; return GO_CLEAROBJ;

View file

@ -65,10 +65,18 @@ OK
OK OK
> say fum
What's the matter, can't you read? Now you'd best start over.
> z > z
OK OK
> find foo
Nothing happens.
> z > z
OK OK
@ -1871,7 +1879,7 @@ OK
What's the matter, can't you read? Now you'd best start over. What's the matter, can't you read? Now you'd best start over.
> >
You scored 253 out of a possible 430, using 315 turns. You scored 253 out of a possible 430, using 317 turns.
You have reached "Junior Master" status. You have reached "Junior Master" status.

View file

@ -46,7 +46,7 @@ z
say fee say fee
say fie say fie
say foe say foe
#say fum say fum
z z
find foo find foo
z z