Today, we're going time travelling! Let's go back to the year CCXVII, so 217, all the way to the iron age: The Roman empire.
But today we're not e...
For further actions, you may consider blocking this person and/or reporting abuse
Well I can't believe it, but I spent ages teaching people how to write roman numerals and they still forget 1, 1000, 51, 6 and 500.
IM LIVID! ππ€£
Seriously though, fun little project, I enjoyed the writeup on it too! β€
Awesome, didn't know that one! So glad you liked it! :) I'm reading some Terry Pratchet currently and stumbled upon differen roman numbers in character's names and thought "why not explain how they work and make a tutorial about that"
Not to be "that guy", but western numbers are not Arabian. They actually came from India. They were called Arabic numbers because at the time they made their way to the western world (modern day Europe), the crusades were happening and that's where we got the knowledge of "Arabic" numerals. They made their way to Arabia from trade links between them and India via the silk road.
I'm no expert, but I got this from a podcast called "you're dead to me" on BBC about history. Very interesting (no, I'm not affiliated π€£)
After doing a bit of research myself, I conclude that I should've done my research better before hitting that "Publish" button... π You're absolutely right, will correct that right away, thank you!
Scratched the original explanation and added the correct one with credits to you. I really didn't do my research good enough there and ended up with this false piece of info. Thank you for pointing that out, helps a great deal to improve the quality of my posts π
Didn't mean to be a detractor from a very good written article. I only learnt a couple of weeks ago myself from that podcast and had always thought they were Arabic too. Just spreading the useless information I pickup so easily (just wish I could do the same with coding π).
Thank you for this solution Pascal!
I am a new programmer/developer and really enjoyed working through your solution, I have added it to my list to go back through the code to get a deeper understanding.
I really liked how you reversed
digits
then usedi
from the for loop to calculatepowerOf10
, nice!Cheers,
Alex :)
You're very welcome, so glad my post helped you. π If you have any questions about it, please feel free to ask, I'm always happy to help!
Very fun puzzle and a great article as well!
Interesting additional information, the rules that we consider normal for Roman numerals are actually a fairly modern invention. The simplest example is that
IIII
was often used instead ofIV
, and still is in some cases such as certain clocks. There were also cases of multiple leading subtractive symbols being used, such asIIXX
for 18 instead ofXVIII
, due to how they spoke, in this case "two from twenty".Such an interesting problem, seems simple on the surface, but the deeper you dig the more edge cases their are.
Thank you very much, glad you enjoyed it! I didn't know that, thank you! The code in the article is not really capable of handling, for example, the
IIXX
case, even though it probably wouldn't take much to cover that, too. It's something I really like about our number system today: There's only ever one way to write a number (that is, if you don't count mathematical expressions or complex numbers...)(Sorry for the late reply)
Thank you for your inputs, very valuable and they do improve the performance! Glad you liked the post. :) It's true that I could've used the array methods like reduce and the spread operator more often. I omitted them on purpose though, as they add complexity for the reader, especially if they're not familiar with them, so they can concentrate on the functionality of the algorithm.
Always great to see Ancient Rome and Computer Science together β€
I'm sure there are many more concepts in ancient mathematics, engineering, astronomy or even economics one could rebuild with JS or any other language! Is there any topic you yourself would be particularly interested in?
(Sorry for the late reply)