Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
link numbers # commas, roman
|
||||
|
||||
procedure main(arglist)
|
||||
every x := !arglist do
|
||||
write(commas(x), " -> ",roman(x)|"*** can't convert to Roman numerals ***")
|
||||
end
|
||||
12
Task/Roman-numerals-Encode/Icon/roman-numerals-encode-2.icon
Normal file
12
Task/Roman-numerals-Encode/Icon/roman-numerals-encode-2.icon
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
procedure roman(n) #: convert integer to Roman numeral
|
||||
local arabic, result
|
||||
static equiv
|
||||
|
||||
initial equiv := ["","I","II","III","IV","V","VI","VII","VIII","IX"]
|
||||
|
||||
integer(n) > 0 | fail
|
||||
result := ""
|
||||
every arabic := !n do
|
||||
result := map(result,"IVXLCDM","XLCDM**") || equiv[arabic + 1]
|
||||
if find("*",result) then fail else return result
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue