Roman numerals/Decode: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
Not a robot (talk | contribs) (Add Refal) |
||
Line 6,239: | Line 6,239: | ||
print roman-to-arabic "MMXVI" |
print roman-to-arabic "MMXVI" |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|REFAL}}== |
|||
<syntaxhighlight lang="refal">$ENTRY Go { |
|||
= <Prout <RomanDecode 'MCMXC'>> |
|||
<Prout <RomanDecode 'MMVIII'>> |
|||
<Prout <RomanDecode 'MDCLXVI'>>; |
|||
}; |
|||
RomanDecode { |
|||
= 0; |
|||
e.D, <Upper e.D>: { |
|||
'M' e.R = <+ 1000 <RomanDecode e.R>>; |
|||
'CM' e.R = <+ 900 <RomanDecode e.R>>; |
|||
'D' e.R = <+ 500 <RomanDecode e.R>>; |
|||
'CD' e.R = <+ 400 <RomanDecode e.R>>; |
|||
'C' e.R = <+ 100 <RomanDecode e.R>>; |
|||
'XC' e.R = <+ 90 <RomanDecode e.R>>; |
|||
'L' e.R = <+ 50 <RomanDecode e.R>>; |
|||
'XL' e.R = <+ 40 <RomanDecode e.R>>; |
|||
'X' e.R = <+ 10 <RomanDecode e.R>>; |
|||
'IX' e.R = <+ 9 <RomanDecode e.R>>; |
|||
'V' e.R = <+ 5 <RomanDecode e.R>>; |
|||
'IV' e.R = <+ 4 <RomanDecode e.R>>; |
|||
'I' e.R = <+ 1 <RomanDecode e.R>>; |
|||
}; |
|||
};</syntaxhighlight> |
|||
{{out}} |
|||
<pre>1990 |
|||
2008 |
|||
1666</pre> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |