You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

1h 49m 24s logged

The quit option:

Added a Q — Quit option to the action menu so it appears on every turn. Typing it exits the game cleanly with a goodbye message. It’s also documented on the instructions screen now.

Trimming dead code:

Character.java carried a full set of getters and setters that nothing in the game actually called — every field is accessed directly. I removed all of them, so Character.java is now just its fields, the ANSI color constants, and a constructor, which is exactly what a data-model class should be.

Board.java documentation:

Added thorough inline comments throughout Board.java, explaining the grid primitives, the ANSI cursor-positioning trick used in printBoard() (the CELL/START column math that keeps emoji aligned), and every map-object method.

The big one — an automated test harness:

The headline addition is TestHarness.java, a standalone tool that stress-tests the whole combat system. It runs every character against every character — all 100 matchups, 20 times each, in two passes (once with map objects, once without) for roughly 4,000 battles. Both fighters are driven by the existing opponent AI, so no input is needed. Each battle is wrapped to catch any exception or assertion failure, and a turn cap catches any battle that never ends. At the end it prints a win-rate matrix plus a count of any crashes or timeouts.

Making this fast required one small change to Fight.java: an animationsEnabled flag, because the attack animation uses Thread.sleep and 4,000 battles of real-time animation would take hours. The flag defaults to on, so normal play is unaffected; the harness flips it off. I wrote the full design into CLAUDE.md before building it.

The first run came back completely clean — 0 exceptions, 0 timeouts, all in about 300ms — and the results matrix matched expectations (Dragon dominates, Goblin and Zombie struggle), which is a good sign the combat, ability, shield, and map-object systems all hold up under every pairing.

Smaller touches:

Added a credits line under the title screen, updated the README with the quit option, the new file, and a testing section.

0

Comments 0

No comments yet. Be the first!