Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,28 @@
local fn RomantoDecimal( roman as Str15 ) as short
dim as short i, n, preNum, num
preNum = 0 : num = 0
for i = roman[0] to 1 step -1
n = 0
if roman[i] = _"M" then n = 1000
if roman[i] = _"D" then n = 500
if roman[i] = _"C" then n = 100
if roman[i] = _"L" then n = 50
if roman[i] = _"X" then n = 10
if roman[i] = _"V" then n = 5
if roman[i] = _"I" then n = 1
if n < preNum then num = num - n else num = num + n
preNum = n
next
end fn = num
print " MCMXC ="; fn RomantoDecimal( "MCMXC" )
print " MMVIII ="; fn RomantoDecimal( "MMVIII" )
print " MMXVI ="; fn RomantoDecimal( "MMXVI" )
print "MDCLXVI ="; fn RomantoDecimal( "MDCLXVI" )
print " MCMXIV ="; fn RomantoDecimal( "MCMXIV" )
print " DXIII ="; fn RomantoDecimal( "DXIII" )
print " M ="; fn RomantoDecimal( "M" )
print " DXIII ="; fn RomantoDecimal( "DXIII" )
print " XXXIII ="; fn RomantoDecimal( "XXXIII" )