Naive engine in Rust and TypeScript (immediate damage, inline triggers, recursive Deathrattles, cards defined in the engine) with test_00_naive_runs and the expected-fail test_00_real_rules_whirlwind_order, plus the Module 0 lesson. Co-Authored-By: Claude Opus 5.5 <[email protected]>
909 B
909 B
Naive engine: Rust
The throwaway engine for Module 0, The Rewrite Trap. It is written the obvious way on purpose: minions are shared references, damage applies at once, triggers fire inline, and a Deathrattle runs the instant a minion's Health reaches 0. Cards are defined inside the engine (make_minion and cast in src/lib.rs).
Run the tests from this directory:
cargo test
You should see two passing tests:
test_00_naive_runspasses normally.test_00_real_rules_whirlwind_order - should panic ... okis expected to fail. It states the real game's event order, which this engine cannot produce, so it is marked#[should_panic]. To see the order the engine actually produces, delete the#[should_panic(...)]line and runcargo testagain.
Do not use this crate in Module 1. Your real engine starts from workspace-template/rust/.