Skip to content
PifeatureCLI & tooling2 files · +664 −334

Tune difficulty and polish a /ping terminal game extension (TypeScript)

Session from pi-mono-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

1h 30msession
0interventions
GOAL

Review code quality of the ping terminal-game extension for the pi coding agent, then iteratively rebalance its ball/AI speed and fix visual bugs until the game was fair and winnable.

  1. Prompt · +0
    Review code quality and style of the ping extension for pi (not the snake one)
  2. Agent did · +0m
    Explored the repo and ~/pi-extensions, located ping.ts and space-invaders.ts, and produced a findings list: legacy save normalization gaps, narrow-terminal handling, food/collision edge cases.
  3. Prompt · +33m
    One-tick grace is fine; the game should pause gracefully when the terminal is too narrow
  4. Agent did · +35m
    Implemented width-based auto-pause/resume in ping.ts, then added a secret vim j/k paddle-hit speed boost per a follow-up request, logging both changes to the long-task-harness progress file.
  5. Fail · +40m
    After testing, the vim speed boost made the ball leave so fast it was impossible to ever beat Pi
  6. Agent did · +41m
    Reworked the boost to a multi-tick burst window, added a point-scored pause with a centered colored score overlay, and swapped the 'game over' text for a green 'YOU WIN!' message in the bottom left.
  7. Fail · +1h 1m
    Even after fixing the vim boost, normal-speed play was still unwinnable, then the AI paddle swung from too slow to too fast across several tuning passes, and a paddle-edge collision looked like a visual glitch
  8. Agent did · +1h 1m
    Iteratively tuned constants: matched base ball speed to the old fast speed, throttled the AI paddle with a tick counter then a fractional accumulator (AI_MOVE_RATE), and restricted paddle bounces to front-face contact only so edge hits let the ball exit instead of snapping back.
  9. Outcome · +1h 30m
    Committed and pushed ping.ts and the progress log only (excluding an unrelated modified space-invaders.ts) as commit d619db6: 2 files changed, 345 insertions, 15 deletions.
VERDICT

Next time I'd start by just playing the game myself before asking for a review, since most of the real bugs (unwinnable speed, glitchy edge bounces, AI difficulty swings) only showed up once I actually tried to beat Pi. The correction that did the most work was pointing out concretely 'it's impossible to win' each time, which forced the agent to rebalance constants instead of guessing at a fix.

I tried this · 0

Discussion · 0

How Builds work