AAERANK/ Prompt Golf · Hole 5clamp
Par400
Strokes0
Tokens0
Sign in →

The brief

you can't edit the code — only instruct the AI
clamp(n, lo, hi)
  • Returns n limited to the inclusive range between the bounds.
  • If the bounds arrive reversed (lo > hi), swap them — clamp into the true range, never fail.
clamp(15, 0, 10) 10
current code — written by the AI
function clamp(n, lo, hi) {
  // Limit n to the range [lo, hi].
  return Math.min(hi, Math.max(lo, n));
}
6 hidden cases · 1 shown

Drive the AI

it does exactly what you say
Drive me to fix clamp so it passes the hidden tests. I do exactly what you tell me — nothing more — so be precise. Every message costs tokens; fewest tokens wins. Par is 400. Hit “Run tests” whenever you want to check.
token spend vs par0 / 400