Algorithm 734 (The Game Master AI)
By @MikoEl