```Hello ,

I have problems with my code for XOR calcul :

a = [1, 0, 1, 1, 0, 0, 1]
b = ["101101", "101100", "110011", "000111", "010110"]
# good result : 000001, 011010,101000, 001010,110000
# false result : ["000001", "000000", "011111", "101011", "111010"]
=> output with this code
# Why ? Because he spends that time with respect b[i].lenght ( = 6
generally ) that prevents take in this case the element 7 and 8 of "a".
# works in case a.length <b [x]. length
# How to resolv this problem ?
i = j = x = 0
c = []
d = []
f = []
5.times { |x| c.push b[x].split('') }

5.times { |i|
e = c[i].length
e.times { |j| d.push(a[j % 7].to_i ^ c[i][j].to_i) }
f.push d
d = []
}
puts "Rsultat brute: "
p f

z = f.length
z.times { |h| f[h] = f[h].join("")}

puts "Rsultats :"
p f

In this case :

a = [1, 0, 1, 1, 0, 0, 1]
b = ["101101", "101100", "110011", "000111", "010110"]

After splitting

b : [["1","0","1","1","0","1"], ["1","0","1","1","0","0"],
["1","1","0","0","1","1"],
["0","0","0","1","1","1"], ["0","1","0","1","1","0"]]

But `a.length => 7` and `b[x].length =>6`

In this code, the xor calcul is performed with only 6 elements in a on
7.

So the calculation is performed here:

a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;

`a` is never use.

and the calculation should be done:

a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;
a ^ b ; a ^ b ; a ^ b ; a ^ b ;
a ^ b ; a ^ b ;

I want to make the right calculation of course but I do not see how to
this.

How to use a as above ?

Thanks

```