well the basic theory is this
000000000
123456789
lets say each of those are values in the array and 0 is empty
so you put a new position, lets say 1 in the array
100000000
123456789
so you go through the array and make the first one in the row a 1 and then they click again, so you get to point 2
120000000
123456789
now you have 2 pts in the array. now lets say your character gets to pt 1, you remove it from the array
020000000
123456789
and then go thru each of the values and move it up one more slot so that they are next in line
200000000
123456789
that way they will go to point 2 next.
That is just one way to do it, but if you practice with arrays you will learn several ways to do it. You might want to google things such as stack's, deque's, queues, bubble searches and binary searches. They are all programming techniques for manipulating an array.
now you click some where else in the array