Roman numerals/Encode: Difference between revisions

Line 3,130:
 
<syntaxhighlight lang="text">
funcproc num2romdec2rom numdec . rom$ .
values[] = [ 1000 900 500 400 100 90 50 40 10 9 5 4 1 ]
symbol$[] = [ "M" "CM" "D" "CD" "C" "XC" "L" "XL" "X" "IX" "V" "IV" "I" ]
rom$ = ""
for i = 1 to len values[]
while numdec >= values[i]
rom$ &= symbol$[i]
num dec -= values[i]
.
.
.
call num2romdec2rom 1990 r$
print r$
call num2romdec2rom 2008 r$
print r$
call num2romdec2rom 1666 r$
print r$
</syntaxhighlight>
1,969

edits