About Last Stone
Last Stone is a version of Nim, an ancient game that mathematicians solved completely in 1901. That does not make it easy. Until you know the secret, a player who does will beat you every single time, and you will not see how.
How a match works
The rows hold three, five and seven stones. On your turn, choose one row and remove one or more stones from it. You may take the whole row if you wish. Tapping a stone removes that stone and all the ones to its right.
The players alternate until nothing is left. Whoever removes the final stone is the winner. The game picks at random who goes first.
Playing by instinct
Try a few games before reading further. You will notice some patterns. Leaving your opponent with two equal rows is good for you: whatever they take from one, you take the same from the other, and you will take the last stone. Leaving rows of one, two and three is also a winning position.
The method
The full solution uses binary numbers. Write each row as a sum of fours, twos and ones. Three is 2 + 1. Five is 4 + 1. Seven is 4 + 2 + 1. Now count each size across all the rows. Here there are two fours, two twos and three ones.
A position is safe to leave for your opponent when every size appears an even number of times. At the start the ones are odd, so the first player can win, by taking a single stone from any row. That makes everything even.
After that, whatever your opponent does will make something odd, and you can always restore the balance. Keep doing it and the last stone is yours.
Going first with perfect play wins. Going first without it usually does not. As strategy HTML5 games go, it is tiny and endlessly instructive.