You just have to be lucky and stumble upon a sequence that allows you to surive.
The RNG is seeeded though, always same seed, so you can determinarically explore all moves and find some sequences that lead to higher scores.