From: Eric S. Raymond Date: Mon, 3 Apr 2023 10:10:12 +0000 (-0400) Subject: Nothing but FOO can start a magic-word sequence, X-Git-Tag: 1.15~6 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0a1f5dbb43aacb696f9219a03b96376c06f7122e;p=open-adventure.git Nothing but FOO can start a magic-word sequence, 100% coverage ans oldcompare passes. --- diff --git a/actions.c b/actions.c index 5d763b9..936e4d8 100644 --- a/actions.c +++ b/actions.c @@ -194,6 +194,11 @@ static phase_codes_t bigwords(vocab_t id) { int foobar = abs(game.foobar); + if ((foobar == WORD_EMPTY) && (id == FIE || id == FOE || id == FOO || id == FUM)) { + rspeak(NOTHING_HAPPENS); + return GO_CLEAROBJ; + } + if ((foobar == WORD_EMPTY && id == FEE) || (foobar == FEE && id == FIE) || (foobar == FIE && id == FOE) || diff --git a/tests/magicwords.chk b/tests/magicwords.chk index 7263870..54ab5a5 100644 --- a/tests/magicwords.chk +++ b/tests/magicwords.chk @@ -13,6 +13,14 @@ Seed set to 1838473132 You're in front of building. +> foo + +Nothing happens. + +> say foo + +Nothing happens. + > in You are inside a building, a well house for a large spring. @@ -1863,7 +1871,7 @@ OK What's the matter, can't you read? Now you'd best start over. > -You scored 253 out of a possible 430, using 313 turns. +You scored 253 out of a possible 430, using 315 turns. You have reached "Junior Master" status. diff --git a/tests/magicwords.log b/tests/magicwords.log index 0f93def..f636711 100644 --- a/tests/magicwords.log +++ b/tests/magicwords.log @@ -33,8 +33,8 @@ n seed 1838473132 # Test isolated 'foo' word -#foo -#say foo +foo +say foo in # Say bigwords ending with foo when not in Giant's Room say fee @@ -48,7 +48,7 @@ say fie say foe #say fum z -#find foo +find foo z take lamp xyzzy