After playing a couple more times, you are right that it's random. I must have gotten lucky the first time. It would be much more fun with more sophisticated AI or other players so you could try to predict their moves.