‹ back to the board

Thursday, October 1

Novicesyntax & basics

The Warden Door of the Sunken Vault

Beneath the drowned hills east of Bitwick lies the Sunken Vault, sealed by a warden door that judges every adventurer who lays a hand on it. The Delvers' Guild will pay well for a charm that predicts the door's verdict before anyone risks the descent.

The door follows exactly these rules:

  • A cursed adventurer is always refused, whatever else is true of them.
  • An adventurer who is not cursed is admitted if they carry the vault key, or if their level is 10 or higher.
  • Anyone else is refused.

Write wardenDoor(level, key, cursed), where:

  • level is a non-negative integer, the adventurer's level.
  • key is a boolean, true if the adventurer carries the vault key.
  • cursed is a boolean, true if the adventurer bears a curse.

Return a boolean: true if the door admits the adventurer, false if it refuses them.

  • boolean expressions
  • Novice

examples

  1. case 1level 10, no key, not cursedtrue (level 10 is enough on its own)
  2. case 2level 4, carries the key, not cursedtrue
  3. case 3level 20, carries the key, cursedfalse (the curse overrides everything)
  4. case 4level 9, no key, not cursedfalse
reward
150 XP
signature
wardenDoor
not yet run

TypeScript, run as ES2022 — types are stripped, not checked. If a JS engine would run it, so will we.

loading the editor…
  • high level, no key, not cursed
  • exactly level 10 passes
  • level 9 without key is refused
  • low level with key passes
  • curse overrides key and level
  • level zero, nothing else
  • cursed with key at low level
  • cursed high level without key
  • level zero with key passes
The Warden Door of the Sunken Vault · bitwick