Novicesyntax & basics
The Griffin-Nests of Halvoran Crag
High on Halvoran Crag, the griffins of the eastern peaks lay their clutches in nests of iron-bark and stolen spearshafts. The Talonward Company pays well for an accurate count of eggs, and each nest a climber reaches must be marked with a painted tag before the mother returns.
Write nestTag(name, eggs), which builds the tag for one nest.
nameis a string: the name of the griffin that guards the nest. Use it exactly as given.eggsis a non-negative integer: the number of eggs in the nest.
Return a string in exactly one of these three forms, with a single space after the colon:
- If
eggsis0:<name>: no eggs - If
eggsis1:<name>: 1 egg - Otherwise:
<name>: <eggs> eggs, with the number written in ordinary digits.
Only the exact value 1 uses the singular word egg. Every other count above zero uses eggs.
examples
- case 1
name of "Skarra", eggs of 3"Skarra: 3 eggs" - case 2
name of "Vell", eggs of 1"Vell: 1 egg" - case 3
name of "Ommeth", eggs of 0"Ommeth: no eggs" - case 4
name of "Brisk", eggs of 11"Brisk: 11 eggs"
- reward
- 130 XP
- signature
nestTag
TypeScript, run as ES2022 — types are stripped, not checked. If a JS engine would run it, so will we.
loading the editor…
- several eggs
- exactly one egg is singular
- empty nest says no eggs
- eleven is plural
- twenty-one is plural
- name kept exactly as given
- large clutch