Skip to content

Reward clears under par, and tighten loose pars (Floor 48 13→9, 22 and 45 9→8) - #90

Merged
kevsaj merged 4 commits into
mainfrom
beat-par
Nov 27, 2026
Merged

kevsaj merged 4 commits into
mainfrom
beat-par

Conversation

@kevsaj

@kevsaj kevsaj commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Requested by Kevin · project thread

Kevin cleared Floor 48 "Antenna Array" in 9 commands against a par of 13, and the results card just said "Perfect run!". This PR adds a reward for clears under par and tightens the pars that turned out to be loose.

Under par reward (free)

A clear beats par when it is within both pars and under at least one of them (beatsPar in progress.ts). On tower floors, the daily and Overflow (not player-made floors):

  • Results card: headline "Under par!" in a new diamond-blue token (--under), a 💎 "N commands under par" badge, the commands chip outlined in blue, and a PATCH line: "9 commands? My best was 13. Nice find!" Colourful mode keeps the blue border. Reduce motion shows the same card with no animation.
  • Tower map: a 💎 beside the stars on floors cleared under par, and "Beat par" in the row's screen-reader label.
  • Locker: new achievement Par breaker 💎 ("Beat par on any tower floor").
  • Saved: progress.underPar[floorId] = fewest commands of an under-par clear. Sanitized, so it rides in backup codes.
  • Stats: a new under_par event (floor, commands, steps), sent once per new best, so loose pars show up in the Sheet. Code.gs needs the new type (under_par: 1 in TYPES): paste and redeploy, which is already on the to-do list from PR Harden save loading, backup import and stats endpoint #40.
  • French for every new string.

Par fixes

LV-4 searches floors with if/while without sensors, and searches function floors only with small loop and function bodies. So shorter programs could get through. New npm run par:scan searches with if/while and F1 included (keeping only the smallest of programs that act the same, with a time budget per floor). A hit must stay within the step par, so 3 stars stays reachable.

Floor Par Now Reference
T1 F48 Antenna Array 13 9 Kevin's: F1 def F1 { while not wall_ahead { forward if tile_is g { turn_right } if wall_ahead { activate turn_right turn_right } } }
T1 F22 Workbench 9 8 repeat 2 { F1 repeat 2 { F1 turn_right } } def F1 { forward forward activate }
T1 F45 Crate Lift 9 8 repeat 2 { F1 } def F1 { turn_left pick_up turn_right drop repeat 3 { jump } }

Hints 2 and 3 on those floors now follow the new solutions (English and French).

Left as is on purpose: T3 F38 "Bug Hunt: Wrong Question" (par 6). A 5-command program exists (wait while not wall_ahead { forward while wall_ahead { turn_right } }), but it skips the bug fix the floor is about, so finding it earns "Under par" instead.

Scan coverage: 69 floors settled (no shorter program) and 3 changed. 18 floors were too big to settle even with 3 minutes each: T1 F23, 37-40, 44, 46, 49; T2 F29, 35, 40, 49, 50; T3 F37, 39, 45, 48, 50. Floor 48 was one of those before Kevin found the 9. Floors with F2, twins, partners, recursion or the tally aren't scanned (the existing LV checks cover them). The new reward plus the under_par stats event is the safety net for any par we missed.

Screenshots (Floor 22, 8 commands vs par 9)

Results Map French Colourful Colourful map Reduce motion

Tests

tsc -b is clean and the full vitest run passes: 2796 tests, including LV-1 to LV-4 on the changed floors. New unit tests cover beatsPar, recordUnderPar and the backup round trip.

Kevin asked not to build a new APK for small tweaks, so this ships with the next build.


Generated by Claude Code

… breaker badge, stats event

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnC1czCvYuRNwbg3qV7svZ
…t-program search)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnC1czCvYuRNwbg3qV7svZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnC1czCvYuRNwbg3qV7svZ
@kevsaj kevsaj self-assigned this Nov 26, 2026
@kevsaj
kevsaj merged commit d042ee2 into main Nov 27, 2026
3 checks passed
@kevsaj
kevsaj deleted the beat-par branch November 27, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants