The code for the post "Optimism in the Face of Uncertainty: the UCB1 Algorithm"