Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
function RomanNumeralsDecode numerals
|
||||
put {
|
||||
"M": 1000,
|
||||
"D": 500,
|
||||
"C": 100,
|
||||
"L": 50,
|
||||
"X": 10,
|
||||
"V": 5,
|
||||
"I": 1
|
||||
} into values
|
||||
|
||||
put 0 into total
|
||||
repeat with each character letter of numerals
|
||||
if values.(character the counter + 1 of numerals) is less than or equal to values.(letter)
|
||||
add values.(letter) to total
|
||||
else
|
||||
subtract values.(letter) from total
|
||||
end if
|
||||
end repeat
|
||||
return total
|
||||
end RomanNumeralsDecode
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
repeat for each item in [
|
||||
"MCMXC",
|
||||
"MMVIII",
|
||||
"MDCLXVI",
|
||||
]
|
||||
put RomanNumeralsDecode(it)
|
||||
end repeat
|
||||
Loading…
Add table
Add a link
Reference in a new issue