October 2025
Intermediate to advanced
100 pages
2h 27m
English
| Puzzle 7 | Anything You Want Me to Be |
| | sealed interface Creature |
| | |
| | object Dragon : Creature |
| | object Unicorn : Creature |
| | object Yeti : Creature |
| | |
| | fun main() { |
| | val mysteryFootprints: Yeti? = null |
| | |
| | when (mysteryFootprints) { |
| | is Dragon? -> println("Looks like the claw-marks of a huge dragon.") |
| | is Unicorn? -> println("I see the hoof-prints of a magical unicorn.") |
| | is Yeti? -> println("These huge footprints prove the yeti is real!") |
| | null -> println("There aren't any footprints.") |
| | } |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess the output (or error) ... |
Read now
Unlock full access