Explore 12 different ways to solve the Roman Numerals exercise on Exercism, and convert Arabic numbers into Roman numerals.
Explore a variety of different solutions to this tricky exercise, ranging from recursion to table-based lookups, one solution that makes use of mixed radix numbers, and some simplistic cheating by Common Lisp!
Kick back and enjoy 45mins of learning with Jeremy and Erik, then go solve the exercise in your favourite way on Exercism.
Solve the exercise at: https://exercism.org/exercises/roman-...
Join #48in24 at: https://exercism.org/challenges/48in24
Featured solutions:
https://exercism.org/tracks/common-li...
https://exercism.org/tracks/csharp/ex...
https://exercism.org/tracks/crystal/e...
https://exercism.org/tracks/awk/exerc...
https://exercism.org/tracks/gleam/exe...
https://exercism.org/tracks/python/ex...
https://exercism.org/tracks/elixir/ex...
https://exercism.org/tracks/mips/exer...
https://exercism.org/tracks/cpp/exerc...
https://exercism.org/tracks/julia/exe...
https://exercism.org/tracks/nim/exerc...
https://exercism.org/tracks/javascrip...
Timestamps:
00:00:00 Introduction
00:01:28 String functions (Common Lisp)
00:02:44 String replacement (C#)
00:05:52 Maps and Loops (Crystal)
00:09:03 Elegance with whiles and Ifs (AWK)
00:11:42 Recursion (Gleam)
00:13:29 Recursion with increments and decrements (Python)
00:17:08 How my brain thinks about it (Elixir)
00:25:26 MIPS version of the Elixir solution
00:30:27 Table-based approach #1 (C++)
00:34:14 Small Table-based approach (Julia)
00:41:31 Branchless (Nim)
00:46:18 Mixed Radix Numbers (JS)
00:57:00 Conclusion