Exercises with hidden tests

Write the function; hidden tests judge it. Vim keys, saved code and share links.

Framework decisions behind it: D49, D60, D61.

An exercise is a playground with tests the reader does not see. Write fact, the factorial, and press Run: the Checks tab names what failed.

(* fact n is n * (n - 1) * ... * 1, and fact 0 is 1. *) let rec fact n = ignore n; 0

What this gives a reader

  • Vim keys. The toolbar has a Vim keys checkbox; keymap="vim" turns it on from the start.
  • Saved code. Edits are kept in this browser (storage="local"). Reload the page and the code is still yours; Reset brings back the original.
  • A link to your code. share="fact" lets an address with #fact=… fill the playground, so a reader can send a solution.
  • Keyboard and screen readers. Everything above works without a mouse; Escape leaves the editor, and results are announced.
  • Narrow screens and touch. The layout stacks, and the toolbar buttons are large enough for a finger.