John Henry said to his captain,

"A man ain't nothin' but a man.

But before I let that steam drill beat me down,

I'll die with my hammer in my hand,

Lord, Lord,

Die with my hammer in my hand."

It was flesh and blood against programmed microcircuits; and when the dust had settled in the most momentous confrontation since John Henry vs. the steam drill, mankind stood bloody but unbowed.

That is, British chess master David Levy won a two-week, five-game grudge match in Toronto against a computer program named Chess 4.7 by a score of 3 to 1.

In doing so, Levy won a bet he had made with a group of computer scientists in 1968 that no mere machine would be able to win a match from him, playing under standard tournament conditions, within the next 10 years.

The memorable meeting a man and machine took place inside an air-conditioned glass cubicle amid the carnival atmosphere of Toronto's Coliseum, a massive old building that houses activities ranging from horse shows to flea markets.

Inside the cubicle, at one side of a table, sat a single human being, David Levy, 33, British master of the game, former chess champion of Scotland and computer technician. He was neatly decked out in a tuxedo, with black tie and ruffled shirt. In front of him was an electronic chessboard with wires coming out of it and lights occasionally flashing.

Marshalled on the other side were some of the most awesome accomplishments of modern science. Hundreds of miles away in Arden Hills, Minnesota, and connected to Toronto by a long-distance line was the challenger, Control Data Cyber 176, dressed in a quiet beige-and-anodized aluminum finish. Designed to handle the massive calculations required for nuclear research, the Cyber 176 is described by Control Data as the largest fastest computer hardware commercially available.

Telling Cyber how to play was the program, Chess 4.7, shipped out of Northwestern University as a set of commands on magnetic tape and incorporated into the computer's memory banks. Chess 4.7, now about 5 years old, is a lineal descendant of Chess 3.0 and was developed at North western by Lawrence W. Atkin and David J. Slate.

(They change the numbers in the name to keep track as the program is improved. Approximately 20-man-years of work have gone into Chess 4.7. During the last six months, Slate switched from full-time to part-time work so that he could spend more time preparing the program for its moment of truth.)

Inside his booth, Levy was shielded from the turmoil outside. The glass walls were double-glazed to cut down noise, and the air-conditioner purred quietly in the background. There was a rug on the floor, and some comfortable borrowed furniture.

The special chessboard had sensors built into it and the pieces were weighted with magnets on the bottom, so that each move was communicated instantly to the computer. When the computer was ready to move, it would flash lights on the chessboard: one to indicate which piece was to move and another to show the square it was going to.

The strain began early. On its 12th move in the first game, the computer offered a very speculative knight sacrifice, and within a few moves it had Levy almost immobilized, as he valiantly fought off one threatened checkmate after another. Levy hung on grimly, launched a small counterattack, but by move 34 he was three pawns behind. He managed to achieve a drawn endgame in the following 30 moves only by playing with a machine-like precision.

It was the first time in history that a computer had held an international master to a draw playing under regular tournament conditions, and undoubtedly the most impressive performance by a computer in the history of chess. It was topped a week later when Chess 4.7 actually won a game, but by that time Levy was experimenting with a style like the computer's, trying to see if he could beat it at its own game. He couldn't.

Chess 4.7 is particularly good at speed chess, in which the players must move without stopping to thin, and has beaten several grandmasters under those conditions. It made a stir in chess circles two years ago (when it was Chess 4.5) by taking first place in the Class B section of the Paul Masson tournament in California. It was not allowed to take a cash prize, but some of the human players complained anyway because they had to play against a computer and their scores were affected.

Now, computers regularly enter human tournament (they have to get a special certificate and the permission of the tournament director) and also have tournaments of their own (Chess 4.7 is the world champion). Chess 4.7 is listed on the roster of the U.S. Chess Federation along with more than 50,000 humans. Its playing strength is rated at 2030, which puts it in the expert category, one step below master.

It had played 31 rated tournament games against humans to achieve this rating by the time it took on David Levy.

That confrontation had been arranged 10 years ago when Levy, then chess champion of Scotland, attended a workshop on machine intelligence at the University of Edinburgh. At a cocktail party, he played a game of chess with John McCarthy, one of the world's leading authorities in the field. After losing, McCarthy said that within 10 years there would be a computer program that could beat Levy, and Levy offered to bet 500 pounds that there would not.

During the next few years, artificial intelligence experts in the United States (MIT, University of California and Northwestern) got into the betting on both sides. The final state amounted to 500 pounds sterling plus $1,000.

It was that wager that had brought Levy to the glass cubicle in the middle of the Canadian National Exhibition, a three-week annual fair that is celebrating its 100th anniversary this year. Crowd's milled about, some interested in chess and some enjoying other diversions.

(On the floor, below Levy, a trained chicken was taking on all comers at tic-tac-toe, for a charge of 25 cents per game - and winning.)

Spectators could stare through the walls to watched Levy thinking or follow the progress of the game on a large demonstration board at one end of the hall. While Levy was locked in his long, solitary struggles, a member of the Toronto chess scene, Polish refugee Josef Smolij, was playing blitz games against all comers elsewhere in the hall. Several Canadian masters gave simultaneous demonstraions when Levy was not playing and commented on the computer game while they were in progress.

Between games with the computer, Levy would fraternize with the humans who were associated with his opponent: John Douglas of Control Data Corp., who updated the computer's opening history, and Slate of Northwestern.

It was during such a recreational session after the third human-machine encounter that Levy got the idea that led to his only loss in the match. Smolij showed him a wild variation of the Greco countergambit, and Levy got the idea that led to his only loss in the match. Smolij showed him a wild variation of the Greco countergambit, and Levy decided to use it in the forth game. "This is the 'smash-grab' gambit," Levi announced, and gave Smolij credit for thinking it up.

(After Levy lost the game, Smolij complained: "This gambit is supposed to be used against people, not against machines.")

Douglas, explaining Levy's loss, said: "All he had to do to win was repeat one of his other games and the computer would probably have made the same mistakes again. But he was very sporting about it. He said, 'I want to play it one game in its own style,' tactical rather than strategic. He did and he lost."

But it was to be his only defeat.

"In playing against a machine whose program you know, you can guarantee that the machine will do certain things and not others," Levy said after the match.

"You cannot count on a human making preprogrammed mistake because humans are much more adaptable; the machine will go on repeating the same mistake while the human has a chance of learning from past mistakes."

With his knowledge of how computer "think," Levy had little troble winning the second, third and fifth games - and with them, the math - and he probably lost the fourth only because he was using someone else's opening and trying to meet the machine on its own terms.

He said that he is thinking of renewing his bet against the computer, probably for a period of not more than five years, but that it will be a few more days before he decides for sure. In the next five years, he thinks, it is likely that a computer program will be developed that will have a fair chance of beating him.