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
|
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
|
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
|
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
|
here.** C tests `!(real & F_REAL)` before drawing and `!real` after, and
|
||||||
flag word — after. `new_level` seeds every square with `p_flags = F_REAL`,
|
since `new_level` seeds every square with `p_flags = F_REAL` the squares
|
||||||
and exactly three sites clear that bit. `passages.c putpass` sets `F_PASS`
|
that lose it keep other bits (`F_PASS` from `putpass`, a non-zero
|
||||||
first, so its secret passage is left at `0x80`. `passages.c door`'s
|
`rnd(NTRAPS)` from the trap loop), so C turns standout on at the first
|
||||||
secret-door arm clears it on a room-wall exit whose flags are still exactly
|
secret square and never off — the rest of the map renders reversed.
|
||||||
`F_REAL` (`rooms.c` writes no `p_flags` at all), leaving `p_flags == 0`; its
|
`game/wizard.go` tests `isReal` both times and highlights the one square.
|
||||||
per-square gate is `rnd(5) == 0` against `putpass`'s `rnd(40) == 0`, and
|
That is a display-only difference in a wizard-only command and was reported
|
||||||
`game/passages.go`'s `door` reproduces it. `new_level`'s trap loop then ORs
|
on the issue rather than changed here; the test asserts the map characters
|
||||||
in `rnd(NTRAPS)`, which is `abs((int) RN) % 8` and so yields `0..7`, and
|
unconditionally but the standout attribute only up to the first secret
|
||||||
`T_DOOR` is `00` — an unsprung trapdoor square is also exactly zero
|
square, so it pins nothing that C contradicts.
|
||||||
(`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.
|
|
||||||
|
|
||||||
Two things the tests had to be built around. The `insist` arm of `whatis` is
|
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
|
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
|
script that runs dry hangs instead of failing — every sequence here ends in
|
||||||
re-prompt ends in an abort tail, the `n_objs == 0` exit is reached the way a
|
an abort tail, the `n_objs == 0` exit is reached the way a player reaches it
|
||||||
player reaches it (`*` for a list with nothing appropriate in the pack)
|
(`*` for a list with nothing appropriate in the pack) rather than by poking
|
||||||
rather than by poking the counter, and the one mutation that deletes that
|
the counter, and the one mutation that deletes that exit is the only one of
|
||||||
exit is the only one of the 30 that fails by timeout instead of fast,
|
the 30 that fails by timeout instead of fast, necessarily so. And `show_map`
|
||||||
necessarily so. And `show_map` does **not** mark squares seen — it writes
|
does **not** mark squares seen — it writes into `hw` and touches no `PLACE`
|
||||||
into `hw` and touches no `PLACE` at all — so the issue's wording for it
|
at all — so the issue's wording for it could not be tested as written; the
|
||||||
could not be tested as written; the loop bounds are asserted instead by
|
loop bounds are asserted instead by planting a marker in the rows C's loop
|
||||||
planting a marker in the rows C's loop excludes, since those rows are blank
|
excludes, since those rows are blank on a real level and copying blanks over
|
||||||
on a real level and copying blanks over blanks would have made the bound
|
blanks would have made the bound unfalsifiable.
|
||||||
unfalsifiable.
|
|
||||||
|
|
||||||
- 2026-08-09 Wands and staffs under test (`test/sticks-coverage`, closes #6):
|
- 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
|
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 */
|
// if (!real) wstandend(hw); /* whole word, not the bit */
|
||||||
//
|
//
|
||||||
// new_level.c seeds every square with p_flags = F_REAL, and exactly three
|
// new_level.c seeds every square with p_flags = F_REAL, and the squares
|
||||||
// sites clear that bit. putpass sets F_PASS first, so a secret passage is
|
// that lose F_REAL keep other bits (F_PASS from putpass, a non-zero
|
||||||
// left at 0x80. door's secret-door arm clears it on a room-wall exit whose
|
// rnd(NTRAPS) from the trap loop), so C turns standout on at the first
|
||||||
// flags are still exactly F_REAL, leaving p_flags == 0. And the trap loop
|
// secret square and never turns it off again. game/wizard.go tests isReal
|
||||||
// ORs in rnd(NTRAPS), which is 0..7, so the T_DOOR (00) case is zero too
|
// both times and highlights the single square. That divergence is
|
||||||
// until be_trapped ORs F_SEEN in. So C's wstandend does fire, at secret
|
// reported on issue #7 rather than settled here, so this test asserts only
|
||||||
// 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
|
|
||||||
// what both agree on: the characters everywhere, standout on every
|
// what both agree on: the characters everywhere, standout on every
|
||||||
// non-real square, and no standout on real squares before the first
|
// non-real square, and no standout on real squares before the first
|
||||||
// non-real one.
|
// 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
|
// and stops before NUMLINES-1, so the top line stays free for show_win's
|
||||||
// prompt and the status line is never overwritten.
|
// prompt and the status line is never overwritten.
|
||||||
func TestShowMapLoopBoundsMatchC(t *testing.T) {
|
func TestShowMapLeavesTheRowsCOmits(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
g := mkWizard(t, 32, 10)
|
g := mkWizard(t, 32, 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user