Why is there a unique solution to the frog puzzle? I'm pretty sure this is a trivial question but eh...
The Frog Puzzle is a famous 8th-grade problem (playable here):

$3$ red frogs and $3$ blue frogs are sitting on lily pads, with a spare lily pad in between them. 
Frogs can slide onto adjacent lily pads or  jump over a frog; frogs can't jump over more than one frog. Frogs can't move backwards.
Can we swap the red frogs with the blue frogs?

It's fairly easy to solve, even for $n$ red frogs and $m$ blue frogs. But I find it very hard to "mathematize" it : should we see the "pond" as an element of $(\mathbb{Z}_3)^7$ ? Then how can we describe the possible moves ?
Unable to translate this into familiar mathematical terms, I'm thereby very puzzled by this... puzzle. In particular, I can't seem to find why is there always a solution, and only one (up to symetry of course), for any number of frogs. I've tried to make it work in Scylab but I'm very rusty in programmation...
All I've managed to prove is that a frog can't jump over a frog of the same color but I'm not sure this will lead somewhere.
Bonus question : is the number of solution equal to the number of empty lily pads?

Let red and blue flog, $1$ and $2$, and empty pad is $0$, at first we move every $1$s left.
$$\\11・・・100・・・022・・・2$$
$→00・・・011・・・1022・・・2\tag 1$
Now, we prove [$11・・・1022・・・2$] can be [$01212・・・12$]. 
One previous step is $10212・・・12$. We move every $1$s left, $$11212・・・121202$$ Next, move every $2$s right, $$11「01212・・・1212」22$$ Since $「」$ is same with first sequence, repeating this operation, then we get first term $(1)$ [$11・・・1022・・・2$]. Therefore we could say the question has definitely one solution.
Also If one frog can jump same color, it generates a sequence $1220$ or $0112$. 
These cases can never go advance anymore.   About bonus question, I think it become recurrence sequence, though.
If the numbers of red and blue frogs and empty pad are $n,m,l$, numbers of jump move is $nm$, side move is $l(n+m)$. Because left frogs meet right flog $nm$ times. I got this by a bit borrowing from a Japanese site. 
