Please post your code in code tags.

The repeating pattern, and therefore the part that can be programmed, is:

2, 1
4, 3
6, 5
8, 7
10, 9