In 'dark places' of my HDD there are archives with names like 'sources...'.
I just started to clean it, so I'll post code snippets (after translating to C-script) if I'll find usefull one.
At first:
Code:
string RomanString;
string* RomanToIntStrPtr;
var vals[13]= (1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000);
text roms{
strings=13;
string="I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M";
}
function IntToRoman(num){ //returns num in capital roman digits
var b=12;
str_cpy(RomanString, "");
while (num > 0) {
while (vals[b] > num) {
b-=1;
}
num-=vals[b];
str_cat(RomanString, roms.string[b]);
}
}
example usage:
Code:
...
IntToRoman(20);
str_cat(RomanString, " century Fox");
...