Hundreds of years of chess knowledge was learned and then surpassed by Google DeepMind’s artificial intelligence algorithm in just four hours, it has emerged.

The astonishing programme AlphaZero quickly mastered the ancient game, before coming up with completely new strategies, which are now being analysed by grandmasters.

The algorithm is so extraordinary because it learns from scratch. It has only been programmed with the rules of chess and must work out how to win simply from playing multiple games against itself.

When IBM’s supercomputer Deep Blue beat Gary Kasparov in 1997, it was because it had been programmed with the best moves. But AlphaZero has learned completely on its own.