Hi guys,
ive never visit this forum..this is my 1st time here...i think this is the most suitable forum to my problem.all peoples here is talented about algorithm.
want to discuss with u guys and begging your opinion or suggestion to solve my problem.
i have this input
input[0]={0,1,2,3}
input[1]={0,1,2}
input[2]={0,1,2,3}
input[3]={0,1}
value=2,3
and when value=3,binary
binary[0]={0,1,1,1}
binary[1]={1,0,1,1}
binary[2]={1,1,0,1}
binary[3]={1,1,1,0}
and when value=2,binary
binary[0]={0,0,1,1}
binary[1]={0,1,1,0}
binary[2]={1,1,0,0}
binary[3]={1,0,0,1}
if user choose value=2,result should b like this:
(i take example for binary[0]={0,1,1})
result[0]={x,x,0,0}
result[1]={x,x,0,1}
result[2]={x,x,1,0}
result[3]={x,x,1,1}
result[4]={x,x,2,0}
result[5]={x,x,2,1}
result[6]={x,x,3,0}
result[7]={x,x,3,1}
as u can see,binary[0][0]=0, 'x' take d place.
if binary[0][1] and binary[0][2]=1,
input[2]={0,1,2,3} and input[3]={0,1} take the place alternately.
binary[0][2]=input[3]
binary[0][1]=input[2]
Binary[a]: b is refer to the address of input.
so if binary[0][2] means refer to input[2].
the conclusion is:
result[0]={x,x,input[2][0],input[3][0]}
result[1]={x,x,input[2][0],input[3][1]}
result[2]={x,x,input[2][1],input[3][0]}
result[3]={x,x,input[2][1],input[3][1]}
result[4]={x,x,input[2][2],input[3][0]}
result[5]={x,x,input[2][2],input[3][1]}
result[6]={x,x,input[2][3],input[3][0]}
result[7]={x,x,input[2][3],input[3][1]}
same thing with binary[1],[2] and so on.
i have no problem if value=2,but if value=3 and value could be more than 3 too cause problem to me.if value=2, i can use for loop but my value should be more than 3 depend on user.
fuh!!!
any suggestion guys???