Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Snippets: Arabic to Roman numbers conversion #57482
10/10/05 21:26
10/10/05 21:26
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline OP
Serious User
Lion_Ts  Offline OP
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
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");
...



Re: Snippets: Arabic to Roman numbers conversion [Re: Lion_Ts] #57483
10/11/05 18:17
10/11/05 18:17
Joined: Jul 2004
Posts: 1,924
Finland
Ambassador Offline
Serious User
Ambassador  Offline
Serious User

Joined: Jul 2004
Posts: 1,924
Finland
hmmm.... truly... truly interesting... very nice indeed... hmm...


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1