scapegoat scapegoat Jan 24, 2006 - "typo conver --> convert"

This little program will conver convert numbers to Roman Numerals. It is able to conver convert any value from 1 to 3999. Roman's Romans did not have a consistent numbering scheme after 3999.

 dim i(13) 
dim r$(13)
key$ = "1000 M 900 CM 500 D 400 CD 100 C 90 XC 50 L 40 XL 10 X 9 IX 5 V 4 IV 1 I"
[again]
roman$ = ""
input "Please enter a number:";num
if num < 4000 then
for x = 0 to 12
i(x+1) = val(word$(key$,(x*2)+1))
r$(x+1) = word$(key$,(x*2)+2)
while num >= i(x+1)
roman$ = roman$ + r$(x+1)
num = num - i(x+1)
wend
next x
print "The ROMAN conversion is: ";roman$
else
print "The number to be converted is over 3999 - try again."
end if
confirm "Convert another?";a$
if a$ = "yes" then goto [again]

- bradmoore bradmoore Jan 24, 2006