It has taken more than 18 years, and hundreds of computers to crunch numbers through the night, but yesterday Jonathan Schaefer declared his job done: he had written the world's first program that was unbeatable at the game of draughts.

Chinook, as the program is known, can calculate a winning response to any move made by its opponent. The worst result it can ever have is a draw, according to Dr Schaefer, an expert in artificial intelligence, working at the University of Alberta in Edmonton, Canada.

The game of draughts, played on a board with eight by eight squares, is the most complicated game ever solved thanks to artificial intelligence. The number of possible positions in a game makes it one million times more complex than Connect Four. Even Deep Blue, the chess-playing program developed by IBM, which beat Garry Kasparov in 1997, can lose - because it is not powerful enough to predict every possible outcome of a game.

Dr Schaefer's announcement was met with praise and awe from the artificial intelligence community yesterday, who called it a "huge achievement".

Peter Cowling, a computer scientist at Bradford University, said: "This program could play draughts against God and it would get a draw. But if Deep Blue played chess against God it would lose badly because there's so much it doesn't understand."

In an article yesterday, in the journal Science, Dr Schaeffer and his colleagues describe how they developed intelligent software to prove that, like noughts and crosses, draughts is always a draw if neither player makes a mistake.

Given that there are 500 billion billion possible arrangements of draughts on a board, the proof took extraordinary computing skill, said Professor Cowling.

Dr Schaefer said the effort had taken its toll. "It's been 18 years and my patience has been tried. I was pretty naive in the beginning and didn't think it was going to take so long, but once I'd got it going I was determined to finish it. But this is the end. Life is too short to spend this much time on one thing."

In 1994 Dr Schaefer entered an earlier version of Chinook into the Man-Machine checkers world championship. The program was declared the winner after drawing six games with the undisputed champion, Marion Tinsley, who had to withdraw for health reasons.

Despite attempts to schedule a re-match, none took place. Eight months after relinquishing his title Tinsley died from pancreatic cancer. His death provoked verbal attacks on the scientists who created Chinook, who were accused of driving him to the grave.

"The checkers players said we caused him to die, that it was the stress of playing against Chinook, and we were responsible. They said we could never have beaten Tinsley, because he was too good and that we were imposters," said Dr Schaeffer.

The accusations drove the team to improve Chinook to being unbeatable. "I knew it was possible to build a computer program that could never lose a game. Now, it's absolutely clear that as great as Tinsley was the best he could do against the program [was] draw."

To write Chinook the scientists developed intelligent search software that could analyse a series of potential moves and decide the best. The most impressive achievement was being able to identify a winning move without looking at every possible outcome, a task almost impossible with current computing power.

"A lot of the moves don't have to be considered at all, we looked at only one millionth of the possibilities."

Prof Cowling said: "Solving draughts is a huge achievement. The number of possible moves is truly gigantic, and the intelligent part is finding ways to throw away most of those. Achievements like this are significant steps towards solving much larger technical challenges.

"Suppose you set yourself the goal of making an artificial person, or something that can sit next to a person in a hospital bed and keep them entertained with conversation - how do you get there? You get there by solving increasingly complex AI problems like this."