Task

Create a function taking a positive integer as its parameter and returning a string containing the Roman numeral representation of that integer. Modern Roman numerals are written by expressing each digit separately, starting with the left most digit and skipping any digit with a value of zero.



In Roman numerals:

 1990 is rendered: 1000=M, 900=CM, 90=XC; resulting in MCMXC
 2008 is written as 2000=MM, 8=VIII; or MMVIII
 1666 uses each Roman symbol in descending order: MDCLXVI


( ( encode
  =   indian roman cifr tenfoldroman letter tenfold
    .   !arg:#?indian
      & :?roman
      &   whl
        ' ( @(!indian:#%?cifr ?indian)
          & :?tenfoldroman
          &   whl
            ' ( !roman:%?letter ?roman
              &     !tenfoldroman
                    (       (I.X)
                            (V.L)
                            (X.C)
                            (L.D)
                            (C.M)
                        : ? (!letter.?tenfold) ?
                      & !tenfold
                    | "*"
                    )
                : ?tenfoldroman
              )
          & !tenfoldroman:?roman
          & ( !cifr:9&!roman I X:?roman
            |   !cifr:~<4
              &     !roman
                    (!cifr:4&I|)
                    V
                : ?roman
              & !cifr+-5:?cifr
              & ~
            |   whl
              ' ( !cifr+-1:~<0:?cifr
                & !roman I:?roman
                )
            )
          )
      & ( !roman:? "*" ?&~`
        | str$!roman
        )
  )
& 1990 2008 1666 3888 3999 4000:?NS
&   whl
  ' ( !NS:%?N ?NS
    &   out
      $ ( encode$!N:?K&!N !K
        | str$("Can't convert " !N " to Roman numeral")
        )
    )
);