Running gene crossover algorithm Your task is to accept as input two gene sequences, and a sequence of &quot;cross over points&quot;, and return the gene sequence that results from the indicated cross overs.
What I mean by this is, say you have the sequences [A, A, A, A, A, A, A] and [Z, Z, Z, Z, Z, Z, Z], and cross over points of 2 and 5. The resulting sequence would be [A, A, Z, Z, Z, A, A], because:

Cross Here:   V     V
Indices:  0 1 2 3 4 5 6

Genes 1:  A A A A A A A
Genes 2:  Z Z Z Z Z Z Z

Result:   A A Z Z Z A A
              ^     ^

Note that while I'm using letters here for clarity, the actual challenge uses numbers for genes.
The result is the first sequence until a cross over point is encountered, then the result takes from the second sequence until another cross over point is encountered, then the result takes from the first sequence until a cross over point is encountered...
Input:

Input can be any reasonable form. The two sequences can be a pair, with the points as the second argument, all three can be separate arguments, a single triplet of (genes 1, genes 2, cross-points), a map with named keys...

The cross points will always be in order, and will always be inbounds. There won't be duplicate points, but the list of cross over points may be empty.

Gene sequences will always be the same length, and will be non-empty.

Indices can be 0 or 1 based.

Genes will always be numbers in the range 0-255.

It doesn't matter which argument is &quot;genes 1&quot; or &quot;genes 2&quot;. In the case of no cross over points, the result can either be either entirely &quot;genes 1&quot; or &quot;genes 2&quot;.



Output

Output can be any reasonable form that isn't ambiguous. It can be a array/list of numbers, an array of string numbers, a delimited string of numbers (some non-numeric character must separate the numbers)...

It can be returned or printed to the std-out.



Entries can by full programs or functions.

Test Cases (genes 1, genes 2, cross points) =&gt; result:
[0], [1], [0] =&gt; [1]
[0, 1], [9, 8], [1] =&gt; [0, 8]
[0, 2, 4, 6, 8, 0], [1, 3, 5, 7, 9, 1], [1, 3, 5] =&gt; [0, 3, 5, 6, 8, 1]
[1, 2, 3, 4], [5, 6, 7, 8], [] =&gt; [1, 2, 3, 4]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 2, 3, 6, 8] =&gt; [1, 1, 0, 1, 1, 1, 0, 0, 1, 1]

This is Code Golf.
JavaScript (ES6), 47 45 bytes
Saved 2 bytes thanks to @ETHproductions
Takes input as a triplet [a, b, c] where a and b are the gene sequences and c is the list of 0-indexed cross-points.

x=&gt;x[i=j=0].map(_=&gt;x[(j+=x[2][j]==i)&amp;1][i++])

Try it online!
Commented
x =&gt;                    // given x = [ geneSeqA, geneSeqB, crossPoints ]
  x[i = j = 0]          // initialize i = gene sequence pointer and j = cross point pointer
  .map(_ =&gt;             // for each value in the first gene sequence:
    x[(                 //   access x[]
      j += x[2][j] == i //     increment j if i is equal to the next cross point
    ) &amp; 1]              //   access either x[0] or x[1] according to the parity of j
    [i++]               //   read gene at x[0][i] or x[1][i]; increment i
  )                     // end of map()