| name | ff-euler-ffp |
| description | Use when editing or debugging Project Euler programs in ff/euler/*.ffp, including preserving prompt data, implementing algorithmic solutions, and validating with the Node/Deno preprocessor runtime. |
f-flat-minor Euler Workflow
Use this skill for work in ff/euler/*.ffp.
Tool bootstrap
- Use
mise x -- ... for commands that depend on repo-managed tools such as node, bun, deno, npm, and chomp.
- If a managed tool is missing, run
mise install once from the repo root, then retry the command with mise x -- ....
- Do not switch runtimes just because a bare command is missing from
PATH.
Core rules
- Always solve algorithmically.
- Do not replace a Project Euler solution with a precomputed constant.
- Keep the original constraints and implement the actual algorithm in f-flat-minor words.
- Verify the exact prompt and input data first.
- Confirm the exact Euler problem statement and required literals before editing.
- Preserve long digit/grid content exactly, including ordering.
- Run
.ffp with Node or Deno.
- Python
python/execute.py does not preprocess .ffp.
- Preferred commands:
mise x -- node node/bin/ff-run.ts ff/euler/<file>.ffp
mise x -- node node/bin/ff-run.ts -t ff/euler/<file>.ffp
Runtime gotchas
- Avoid multiline string literals in Euler files; keep long numeric strings as a single quoted token.
pick is not guaranteed in core; implement a local equivalent if needed.
- Queue behavior is fragile in deep helpers:
q< moves top of stack to queue, q> restores from queue.
Debugging workflow
- Validate helper stack effects in tiny probes (for example, temporary files in
/tmp).
- Prove helper words independently before full-scan recursion.
- Use trace mode for stack underflow and ordering bugs:
mise x -- node node/bin/ff-run.ts -t ff/euler/<file>.ffp
- In scan solutions, confirm cleanup only drops dataset values, not the computed result.
- If preserving a result across bulk
drop, move it aside with q< ... q>.
Build order for scan-style solutions
- Parse/representation helpers
- Single-position directional checks
- Max-update logic with explicit stack-shape checks
- Full scan recursion
- Final cleanup and output