3 comments

[ 3.6 ms ] story [ 20.5 ms ] thread
Depends on the language, looks like this one can't do pattern matching? Makes you appreciate languages like Zig, Rust or Odin a lot more
Switches are really only for enumerated/integral types, where a single variable can take on a small number of interesting values. Some if-else situations don't translate to switch-case at all, though. One such is when you're faced with decision tree logic, involving multiple variables. Another occurs when you need to (or are stuck with) matching various strings.
Well played! "Something beyond anything he could possibly imagine", indeed.