module

Display

Constants

BLUE = "\e[34m"
BOLD = "\e[1m"
CYAN = "\e[36m"
DIM = "\e[2m"
GREEN = "\e[32m"
MAGENTA = "\e[35m"
RED = "\e[31m"
RESET = "\e[0m"

ANSI color codes

WHITE = "\e[37m"
YELLOW = "\e[33m"

Class methods

clear

Clear the screen

Source
error(message : String) : Nil

Display error message

Source
header(text : String) : Nil

Display section header

Source
help

Display help information

Source
hp_percent_color(hp : Int32, max_hp : Int32) : String

Pick an ANSI color for the HP readout based on how healthy it is.

Source
info(message : String) : Nil

Display info message

Source
instructions

Display game instructions

Source
narration(text : String) : Nil

Display narrative text from the DM. Renders simple **bold** markdown as ANSI bold so Claude's habitual emphasis doesn't show up as literal stars.

Source
prompt

Display the input prompt

Source
render_inline_markdown(text : String) : String

Render a minimal subset of inline markdown (bold) as ANSI styling. Anything else is left untouched.

Source
rule

Display a horizontal rule

Source
stat(label : String, value : String | Int32 | Float64) : Nil

Display a stat or labeled value

Source
status_line(hp : Int32, max_hp : Int32, room : String, item_count : Int32) : Nil

Display a compact one-line summary of the character's vital state. Printed after each DM turn so tool-driven HP/location/item changes are visible to the player (the deterministic mechanics this demo showcases). Primitives only — keeps Display a leaf module with no dependency on GameState.

Source
success(message : String) : Nil

Display success message

Source
title(text : String) : Nil

Display game title with ASCII art

Source
warning(message : String) : Nil

Display warning message

Source