Päivän noston innoittamana alla oma toteutukseni 8th ohjelmointikielellä.
private [1000,900,500,400,100,90,50,40,10,9,5,4,1] constant num-lookup ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"] constant roman-lookup public : n:>roman \ n -- s >r "" #p:num-lookup ( repeat r@ over n:< !if dup n:neg n:r+ rot #p:roman-lookup 3 pick a:_@ s:+ -rot else 2drop break then again ) a:each drop rdrop ; : app:main 2023 n:>roman . cr ;
root@DietPi:~# /opt/8th/bin/rpi64/8th roman.8th MMXXIII root@DietPi:~#
Aihe on jo aika vanha, joten et voi enää vastata siihen.