‹ back to the board

Sunday, November 1

Novicesyntax & basics

The Dryad-Gate of Ilvenwood

Deep in Ilvenwood stands a ring of ancient oaks whose roots knot together into a living gate. The dryads who tend it have pinned their terms to the Bitwick board. The Rangers' Lodge needs a quick reckoning, made before each expedition sets out, of whether a party will be let through.

The dryads open the gate to a party only when all three of these hold:

1. The party has between 1 and 6 members, inclusive. 2. The party carries no iron. 3. The party arrives at night, or carries a dryad-seal, or both.

Write mayPass(size, iron, night, seal):

  • size is an integer (zero or more): the number of members in the party.
  • iron is a boolean: true if the party carries any iron.
  • night is a boolean: true if the party arrives at night.
  • seal is a boolean: true if the party carries a dryad-seal.

Return true if the gate opens for the party under the three rules above. Otherwise return false.

  • boolean expressions
  • Novice

examples

  1. case 1size of 4, no iron, arriving by day, carrying a sealtrue
  2. case 2size of 3, carrying iron, arriving at night, carrying a sealfalse (iron is refused no matter what)
  3. case 3size of 7, no iron, arriving at night, no sealfalse (the party is too large)
  4. case 4size of 6, no iron, arriving at night, no sealtrue (six is still allowed)
reward
150 XP
signature
mayPass
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…
  • night without seal passes
  • seal by day passes
  • day without seal refused
  • iron refused even at night with seal
  • iron refused at night without seal
  • six members is the upper limit
  • seven members too many
  • empty party refused
  • lone traveller with seal
The Dryad-Gate of Ilvenwood · bitwick