You don't have to do much, just watch Scratch Cat navigate the track!
At first, the cat is just guessing, but then they get better and better at going around the randomly generated track using an AI algorithm! It uses the number of times it guessed the right direction for a part of the track to calculate which direction it should go, but in the beginning, all the values are or are mostly equal, so it uses a random number.