11-23-2006, 04:08 PM
hello
i need your help again, so thank you in advance
i have a string, say for example
str s="r1bqk2r/pppp1ppp/2n2n2/2b1p3/2P1P3/2NP4/PP3PPP/R1BQKBNR w KQkq -"
In my mind, it means I have 8 strings of 8 characters, because in my example a number like 2 mean 2 zeros (00), 3 mean 3 zeros (000) and so on, and i need to take care of MAJ and min characters; so i would like , with my example, define 8 strings and have:
s1="r0bqk00r"
s2="pppp0ppp"
s3="00n00n00"
s4="00b0p000"
s5="00P0P000"
s6="00NP0000"
s7="PP000PPP"
s8="R0BQKBNR"
ps: my string s will ALWAYS be like this : 8 parts separated with "/" , each part meaning 8 characters (letters MAJ and min and zeros 0)
Then, having these 8 strings s1,...,s8, i want to replace every MAJ characters with 1 and every min characters with 2, so with my example i need to have 8 new strings
t1="20222002"
t2="22220222"
t3="00200200"
t4="00202000"
t5="00101000"
t6="00110000"
t7="11000111"
t8="10111111"
Lot of thanks!
i need your help again, so thank you in advance
i have a string, say for example
str s="r1bqk2r/pppp1ppp/2n2n2/2b1p3/2P1P3/2NP4/PP3PPP/R1BQKBNR w KQkq -"
In my mind, it means I have 8 strings of 8 characters, because in my example a number like 2 mean 2 zeros (00), 3 mean 3 zeros (000) and so on, and i need to take care of MAJ and min characters; so i would like , with my example, define 8 strings and have:
s1="r0bqk00r"
s2="pppp0ppp"
s3="00n00n00"
s4="00b0p000"
s5="00P0P000"
s6="00NP0000"
s7="PP000PPP"
s8="R0BQKBNR"
ps: my string s will ALWAYS be like this : 8 parts separated with "/" , each part meaning 8 characters (letters MAJ and min and zeros 0)
Then, having these 8 strings s1,...,s8, i want to replace every MAJ characters with 1 and every min characters with 2, so with my example i need to have 8 new strings
t1="20222002"
t2="22220222"
t3="00200200"
t4="00202000"
t5="00101000"
t6="00110000"
t7="11000111"
t8="10111111"
Lot of thanks!