From 62cd0c78dab69bef371aec943fe78ff464ae4f15 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 15 Feb 2024 12:56:01 -0500 Subject: [PATCH 1/5] Reissue 1.18 - same code, corrected metadata. --- NEWS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.adoc b/NEWS.adoc index 92c2f10..624f6ce 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: (C) Eric S. Raymond // SPDX-License-Identifier: CC-BY-4.0 -1.18: 2024-02-05:: +1.18: 2024-02-15:: Bring the manual page fully up to date. 1.17: 2024-01-02:: -- 2.31.1 From b51612131d7552c9629a1e843b236b5b9be096d5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 29 Apr 2024 11:43:41 -0400 Subject: [PATCH 2/5] Typo fix. --- advent.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advent.adoc b/advent.adoc index d7231f6..f132b0c 100644 --- a/advent.adoc +++ b/advent.adoc @@ -62,7 +62,7 @@ argument of '-' is taken as a directive to read from standard input. The binary save file format is fragile, dependent on your machine's endianness, and unlikely to survive through version bumps. There are -version and emdianness checks when attempting to restore from a save. +version and endianness checks when attempting to restore from a save. The input parser was the first attempt *ever* at natural-language parsing in a game and has some known deficiencies. While later text -- 2.31.1 From 7903ac1bb879208dbe4a4e3e24f21997d53f68d6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 3 Jun 2024 21:12:41 -0400 Subject: [PATCH 3/5] More validation, with -Wall and -Wextra. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0da7fb8..a7acbd8 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ VERS=$(shell sed -n Date: Tue, 25 Jun 2024 13:08:50 -0400 Subject: [PATCH 4/5] Incorporate Ryan Sarson's test for correct knife message. --- tests/knife.chk | 386 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/knife.log | 56 +++++++ 2 files changed, 442 insertions(+) create mode 100644 tests/knife.chk create mode 100644 tests/knife.log diff --git a/tests/knife.chk b/tests/knife.chk new file mode 100644 index 0000000..0c150ec --- /dev/null +++ b/tests/knife.chk @@ -0,0 +1,386 @@ + +Welcome to Adventure!! Would you like instructions? + +> no + +You are standing at the end of a road before a small brick building. +Around you is a forest. A small stream flows out of the building and +down a gully. + +> seed 1640849217 + +Seed set to 1640849217 + +You're in front of building. + +> e + +You are inside a building, a well house for a large spring. + +There are some keys on the ground here. + +There is a shiny brass lamp nearby. + +There is food here. + +There is a bottle of water here. + +> get lamp + +OK + +> xyzzy + +>>Foof!<< + +It is now pitch dark. If you proceed you will likely fall into a pit. + +> get rod + +OK + +> on + +Your lamp is now on. + +You are in a debris room filled with stuff washed in from the surface. +A low wide passage with cobbles becomes plugged with mud and debris +here, but an awkward canyon leads upward and west. In the mud someone +has scrawled, "MAGIC WORD XYZZY". + +> w + +You are in an awkward sloping east/west canyon. + +> w + +You are in a splendid chamber thirty feet high. The walls are frozen +rivers of orange stone. An awkward canyon and a good passage exit +from east and west sides of the chamber. + +A cheerful little bird is sitting here singing. + +> w + +At your feet is a small pit breathing traces of white mist. An east +passage ends here except for a small crack leading on. + +Rough stone steps lead down the pit. + +> d + +You are at one end of a vast hall stretching forward out of sight to +the west. There are openings to either side. Nearby, a wide stone +staircase leads downward. The hall is filled with wisps of white mist +swaying to and fro almost as if alive. A cold wind blows up the +staircase. There is a passage at the top of a dome behind you. + +Rough stone steps lead up the dome. + +> w + +You are on the east bank of a fissure slicing clear across the hall. +The mist is quite thick here, and the fissure is too wide to jump. + +> wave rod + +A crystal bridge now spans the fissure. + +> w + +You are on the west side of the fissure in the Hall of Mists. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You are on the east bank of a fissure slicing clear across the hall. +The mist is quite thick here, and the fissure is too wide to jump. + +A crystal bridge spans the fissure. + +> w + +You are on the west side of the fissure in the Hall of Mists. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You are on the east bank of a fissure slicing clear across the hall. +The mist is quite thick here, and the fissure is too wide to jump. + +A crystal bridge spans the fissure. + +> w + +You are on the west side of the fissure in the Hall of Mists. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You are on the east bank of a fissure slicing clear across the hall. +The mist is quite thick here, and the fissure is too wide to jump. + +A crystal bridge spans the fissure. + +> w + +You are on the west side of the fissure in the Hall of Mists. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +You're on east bank of fissure. + +A crystal bridge spans the fissure. + +> w + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> e + +A little dwarf just walked around a corner, saw you, threw a little +axe at you which missed, cursed, and ran away. + +You're on east bank of fissure. + +There is a little axe here. + +A crystal bridge spans the fissure. + +> w + +There is a threatening little dwarf in the room with you! + +One sharp nasty knife is thrown at you! + +It misses! + +You're on west bank of fissure. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> get knife + +The dwarves' knives vanish as they strike the walls of the cave. + +> look + +Sorry, but I am not allowed to give more detail. I will repeat the +long description of your location. + +There is a threatening little dwarf in the room with you! + +One sharp nasty knife is thrown at you! + +It misses! + +You are on the west side of the fissure in the Hall of Mists. + +There are diamonds here! + +A crystal bridge spans the fissure. + +> get knife + +The dwarves' knives vanish as they strike the walls of the cave. + +> quit + +Do you really want to quit now? + +> yes + +OK + +You scored 59 out of a possible 430, using 50 turns. + +Your score qualifies you as a novice class adventurer. + +To achieve the next higher rating, you need 62 more points. diff --git a/tests/knife.log b/tests/knife.log new file mode 100644 index 0000000..e7477e2 --- /dev/null +++ b/tests/knife.log @@ -0,0 +1,56 @@ +## Test whether KNIVES_VANISH can be issued twice +# SPDX-FileCopyrightText: Copyright Eric S. Raymond +# SPDX-License-Identifier: BSD-2-Clause +no +seed 1640849217 +e +get lamp +xyzzy +get rod +on +w +w +w +d +w +wave rod +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +e +w +get knife +look +get knife +quit +yes -- 2.31.1 From bd499dc53276f28994b7ffc833fb8499fb05c5eb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 25 Jun 2024 13:23:21 -0400 Subject: [PATCH 5/5] Fix GitLab issue #69: repeated knive caveat message --- NEWS.adoc | 3 +++ main.c | 10 ++++++---- notes.adoc | 6 +++++- tests/knife.chk | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/NEWS.adoc b/NEWS.adoc index 624f6ce..28dd018 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -2,6 +2,9 @@ // SPDX-FileCopyrightText: (C) Eric S. Raymond // SPDX-License-Identifier: CC-BY-4.0 +Repository head:: + Ensore that the KNIVES_VANISH message can't issue twice. + 1.18: 2024-02-15:: Bring the manual page fully up to date. diff --git a/main.c b/main.c index 7f5d8a1..6d904f2 100644 --- a/main.c +++ b/main.c @@ -1280,11 +1280,13 @@ static bool do_command(void) { } } - /* Check to see if the room is dark. If the knife is - * here, and it's dark, the knife permanently disappears - */ + /* Check to see if the room is dark. */ game.wzdark = DARK(game.loc); - if (game.knfloc != LOC_NOWHERE && + + /* If the knife is not here it permanently disappears. + * Possibly this should fire if the knife is here but + * the room is dark? */ + if (game.knfloc > LOC_NOWHERE && game.knfloc != game.loc) { game.knfloc = LOC_NOWHERE; } diff --git a/notes.adoc b/notes.adoc index b970e7c..833682c 100644 --- a/notes.adoc +++ b/notes.adoc @@ -78,7 +78,11 @@ Bug fixes: "eying" for "eyeing", "thresholds" for "threshholds". * Under odd circumstances (dropping rug or vase outdoors) the game could - formerly say "floor" when it should say "ground" (or "dirt", or something). + formerly say "floor" when it should say "ground" (or "dirt", or + something). + +* The "knives vanish" message could formerly be emitted when "I see no + knife here." would be appropriate. Enhancements: diff --git a/tests/knife.chk b/tests/knife.chk index 0c150ec..76a3b6b 100644 --- a/tests/knife.chk +++ b/tests/knife.chk @@ -369,7 +369,7 @@ A crystal bridge spans the fissure. > get knife -The dwarves' knives vanish as they strike the walls of the cave. +I see no knife here. > quit -- 2.31.1