Compare commits
1 Commits
6f409bda9e
...
495c4629e4
| Author | SHA1 | Date | |
|---|---|---|---|
| 495c4629e4 |
51
TODO.md
51
TODO.md
@@ -55,40 +55,29 @@ is finished.
|
||||
from the port leaves every weapon test green — which is the evidence that
|
||||
the line is dead for weapons. The armor arm has no such clobber and does
|
||||
keep the curse. (2) **`show_map`'s standout is asymmetric in C and symmetric
|
||||
here.** C tests `!(real & F_REAL)` before drawing and `!real` — the whole
|
||||
flag word — after. `new_level` seeds every square with `p_flags = F_REAL`,
|
||||
and exactly three sites clear that bit. `passages.c putpass` sets `F_PASS`
|
||||
first, so its secret passage is left at `0x80`. `passages.c door`'s
|
||||
secret-door arm clears it on a room-wall exit whose flags are still exactly
|
||||
`F_REAL` (`rooms.c` writes no `p_flags` at all), leaving `p_flags == 0`; its
|
||||
per-square gate is `rnd(5) == 0` against `putpass`'s `rnd(40) == 0`, and
|
||||
`game/passages.go`'s `door` reproduces it. `new_level`'s trap loop then ORs
|
||||
in `rnd(NTRAPS)`, which is `abs((int) RN) % 8` and so yields `0..7`, and
|
||||
`T_DOOR` is `00` — an unsprung trapdoor square is also exactly zero
|
||||
(`be_trapped` is what later ORs `F_SEEN` into it). So C _does_ turn standout
|
||||
off again, at secret doors and unsprung trapdoors; what it gets wrong is
|
||||
leaking the attribute forward from a secret passage or a non-trapdoor trap
|
||||
until it reaches one of those. Intermittent bands of reverse video, not a
|
||||
permanently reversed map. `game/wizard.go` tests `isReal` both times and
|
||||
highlights the one square. That is a display-only difference in a
|
||||
wizard-only command and was reported on the issue rather than changed here;
|
||||
the test asserts the map characters unconditionally but the standout
|
||||
attribute only up to the first secret square, so it pins nothing that C
|
||||
contradicts.
|
||||
here.** C tests `!(real & F_REAL)` before drawing and `!real` after, and
|
||||
since `new_level` seeds every square with `p_flags = F_REAL` the squares
|
||||
that lose it keep other bits (`F_PASS` from `putpass`, a non-zero
|
||||
`rnd(NTRAPS)` from the trap loop), so C turns standout on at the first
|
||||
secret square and never off — the rest of the map renders reversed.
|
||||
`game/wizard.go` tests `isReal` both times and highlights the one square.
|
||||
That is a display-only difference in a wizard-only command and was reported
|
||||
on the issue rather than changed here; the test asserts the map characters
|
||||
unconditionally but the standout attribute only up to the first secret
|
||||
square, so it pins nothing that C contradicts.
|
||||
|
||||
Two things the tests had to be built around. The `insist` arm of `whatis` is
|
||||
a loop whose only exits are picking a matching item and `n_objs == 0`, so a
|
||||
script that runs dry hangs instead of failing — every sequence that can
|
||||
re-prompt ends in an abort tail, the `n_objs == 0` exit is reached the way a
|
||||
player reaches it (`*` for a list with nothing appropriate in the pack)
|
||||
rather than by poking the counter, and the one mutation that deletes that
|
||||
exit is the only one of the 30 that fails by timeout instead of fast,
|
||||
necessarily so. And `show_map` does **not** mark squares seen — it writes
|
||||
into `hw` and touches no `PLACE` at all — so the issue's wording for it
|
||||
could not be tested as written; the loop bounds are asserted instead by
|
||||
planting a marker in the rows C's loop excludes, since those rows are blank
|
||||
on a real level and copying blanks over blanks would have made the bound
|
||||
unfalsifiable.
|
||||
script that runs dry hangs instead of failing — every sequence here ends in
|
||||
an abort tail, the `n_objs == 0` exit is reached the way a player reaches it
|
||||
(`*` for a list with nothing appropriate in the pack) rather than by poking
|
||||
the counter, and the one mutation that deletes that exit is the only one of
|
||||
the 30 that fails by timeout instead of fast, necessarily so. And `show_map`
|
||||
does **not** mark squares seen — it writes into `hw` and touches no `PLACE`
|
||||
at all — so the issue's wording for it could not be tested as written; the
|
||||
loop bounds are asserted instead by planting a marker in the rows C's loop
|
||||
excludes, since those rows are blank on a real level and copying blanks over
|
||||
blanks would have made the bound unfalsifiable.
|
||||
|
||||
- 2026-08-09 Wands and staffs under test (`test/sticks-coverage`, closes #6):
|
||||
the second of the three thin spots the Next Step names. `game/sticks.go` was
|
||||
|
||||
@@ -928,18 +928,12 @@ func TestCreateRingOtherKindsAreLeftAlone(t *testing.T) {
|
||||
// ...
|
||||
// if (!real) wstandend(hw); /* whole word, not the bit */
|
||||
//
|
||||
// new_level.c seeds every square with p_flags = F_REAL, and exactly three
|
||||
// sites clear that bit. putpass sets F_PASS first, so a secret passage is
|
||||
// left at 0x80. door's secret-door arm clears it on a room-wall exit whose
|
||||
// flags are still exactly F_REAL, leaving p_flags == 0. And the trap loop
|
||||
// ORs in rnd(NTRAPS), which is 0..7, so the T_DOOR (00) case is zero too
|
||||
// until be_trapped ORs F_SEEN in. So C's wstandend does fire, at secret
|
||||
// doors and unsprung trapdoors; what it gets wrong is leaking standout
|
||||
// forward from a secret passage or a non-trapdoor trap until it reaches
|
||||
// one of those — intermittent bands, not a permanently reversed map.
|
||||
// game/wizard.go tests isReal both times and highlights the single square.
|
||||
// That divergence is reported on issue #7 rather than settled here, so
|
||||
// this test asserts only
|
||||
// new_level.c seeds every square with p_flags = F_REAL, and the squares
|
||||
// that lose F_REAL keep other bits (F_PASS from putpass, a non-zero
|
||||
// rnd(NTRAPS) from the trap loop), so C turns standout on at the first
|
||||
// secret square and never turns it off again. game/wizard.go tests isReal
|
||||
// both times and highlights the single square. That divergence is
|
||||
// reported on issue #7 rather than settled here, so this test asserts only
|
||||
// what both agree on: the characters everywhere, standout on every
|
||||
// non-real square, and no standout on real squares before the first
|
||||
// non-real one.
|
||||
@@ -985,10 +979,10 @@ func TestShowMapRendersTheWholeLevel(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestShowMapLoopBoundsMatchC pins the loop bounds. C starts at y = 1
|
||||
// TestShowMapLeavesTheRowsCOmits pins the loop bounds. C starts at y = 1
|
||||
// and stops before NUMLINES-1, so the top line stays free for show_win's
|
||||
// prompt and the status line is never overwritten.
|
||||
func TestShowMapLoopBoundsMatchC(t *testing.T) {
|
||||
func TestShowMapLeavesTheRowsCOmits(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
g := mkWizard(t, 32, 10)
|
||||
|
||||
Reference in New Issue
Block a user