Bug#74947: FWD: Bug#74947: bsdgames, wump: cave has incorrect geometry

Paul Nuffer donutcoffee at pm.me
Tue Oct 31 19:31:53 GMT 2023


Hello BSD Games maintainers,

In case there's interest in adding the dodecahedron cave back to wump
without waiting for the other changes mentioned above, I've created a
patch for this.

I used the OpenBSD wump source files to copy these functions. The
OpenBSD dodecahedral_cave_init() creates a 20 room cave with three
tunnels from each room, and creates 2 bats and 2 pits. The nodes are
randomly assigned room numbers to give the appearance of change, but
the layout of the tunnel assignment guarantees each room will have 3
tunnels, and all rooms will be connected.

I adjusted the OpenBSD source in `dodecahedral_cave_init()` to use
`random()` instead of the BSD `arc4random()`, and I changed the
initialization loops to use the variables `room_num` and `link_num` to
match the format of the existing debug call in the same function. The
initial values for bat_num and pit_num were changed to -1 to ensure
the proper default values will be set in `main()` for both oldstyle
and regular play. I added the OpenBSD documentation for the `-o`
option into the wump.6 manpage as well.

I've been playing with this patch on my Debian 12 system, and it works
as I'd expect it to.

Please let me know if you have any questions, or if there's a better
way to submit a patch or discuss this change.

Thanks for your time,

Paul


More information about the Pkg-games-devel mailing list