davideisinger.com

My personal website
Log | Files | Refs | README

index.md (1848B)


      1 ---
      2 title: "Romanize: Another Programming Puzzle"
      3 date: 2015-03-06T00:00:00+00:00
      4 draft: false
      5 canonical_url: https://www.viget.com/articles/romanize-another-programming-puzzle/
      6 ---
      7 
      8 We had such a good time working through our [first programming
      9 challenge](https://viget.com/extend/otp-a-language-agnostic-programming-challenge)
     10 that we decided to put another one together. We had several ideas, but
     11 [Pat](https://viget.com/about/team/preagan)'s idea of converting to and
     12 from Roman numerals won out, and a few hours later,
     13 [Romanize](https://github.com/vigetlabs/romanize) was born.
     14 
     15 The name of the game is to write, in a language of your choice, a pair
     16 of programs that work like this:
     17 
     18     > ./deromanize I
     19     1
     20     > ./deromanize II
     21     2
     22     > ./deromanize MCMIV
     23     1904
     24 
     25     > ./romanize 1
     26     I
     27     > ./romanize 2
     28     II
     29     > ./romanize 1904
     30     MCMIV
     31 
     32 It's a deceptively difficult problem, especially if, like me, you only
     33 understand how Roman numerals work in the vaguest sense. And it's one
     34 thing to create a solution that passes the test suite, and another
     35 entirely to write something concise and elegant -- going from Arabic to
     36 Roman, especially, seems to defy refactoring.
     37 
     38 We've created working solutions in ~~seven~~ ~~eight~~ ~~nine~~ ten
     39 languages:
     40 
     41 -   C (via [Steve132](https://github.com/Steve132))
     42 -   Clojure
     43 -   Elixir
     44 -   Go
     45 -   Haskell (plus check out [this cool
     46     thing](https://gist.github.com/sgronblo/e3d73a61c5dd968b7d29) from
     47     [sgronblo](https://github.com/sgronblo) using QuickCheck and Parsec)
     48 -   OCaml
     49 -   Node.js (via [Xylem](https://github.com/Xylem))
     50 -   PHP
     51 -   Ruby
     52 -   Swift (shout out to [wasnotrice](https://github.com/wasnotrice))
     53 
     54 What's gonna be number eleven? **You decide!** [Fork the
     55 repo](https://github.com/vigetlabs/romanize) and give it your best shot.
     56 When you're done, send us a PR.