John's Chess Program

 

Below is my chess program. I developed this on a NeXT cube computer (1989 era), which can resolve about 1,500 moves per second. I wrote the program indepedently, but drew upon examples from the Internet for direction. Once developed, I ported my program and compiled it to run on a modern 3rd generation (Ivy Bridge) Core 5 laptop, which can examine about 4 million moves per second, compared to 1,500 moves per second on the NeXT.

Chess ZIP file (Mac OS X 10.7.5)

Chess ZIP file (Mac OS X 10.5.8)

Chess ZIP file (Windows 7)

Readable Source Code - The Program

 

 

 

 

But now, it's time to pit my program against a 1978 Fidelity Chess Challenger 10 player. The match up:

 

The Fidelity player, sold for around $275 in 1978, sporting a Z80 8 bit processor, 4KB of ROM, and 0.5KB of RAM.
It has a nice teak wood finish, and boots up instantly. The game, now underway!

 

On the other side, an $800 dollar laptop, made of cheap plastic and faux metal, featuring a CPU that runs over 1,000x faster, and with more memory than an equivalent stack of Chess Challengers from here to Jupiter and back. On the modern machine image below, almost 579 million board positions were evaluated in the last play as it looked at outcomes 7 turns deep. To save time, my program uses a method called Alpha-Beta pruning to help eliminate millions of searches that produce potentially worse results than a previously found best move.

 

 

 

Sparky, my faithful assistant, relaxing nearby, mildly curious.

 

 

Both machines play very conservatively! As the Challenger replies, I key this into the new computer, and vice-versa.
We are now passing 50 moves of play, each side playing very cautiously. Some machine, do something!

 

Finally, after 104 moves, my program beats the 1978 Chess Challenger 10! One caveat, for this first match, I had the Chess Challenger playing on entry level, I'll have to crank it up higher and have a follow up match. My guess is the old game, at a higher play level, might beat my basic chess program!

 

An insert sheet that came with the Fidelity Challenger 10. Back in 1978, few consumer products had a general purpose CPU, thus the introduction below. Home chess computers only appeared the year before, in 1977, with the Fidelity Chess Challenger 1.

The Final play of the tournament game:


Searched 210062076 nodes.
Nodes pruned at Ply 1: 243
Nodes pruned at Ply 2: 908
Nodes pruned at Ply 3: 20658
Nodes pruned at Ply 4: 231485
Nodes pruned at Ply 5: 3087351
Nodes pruned at Ply 6: 45082998
 
Moving Rook c1 to h1
 
Time elapsed: 56 seconds
Nodes per second: 3751108
 
You are in check!
 
Checkmate!
 
 
         a    b    c    d    e    f    g    h
 
    8    .    .    k    .    .    .    .    .
 
    7    .    .    .    .    .    r    .    .
 
    6    .    R    .    .    .    .    .    .
 
    5    .    P    .    .    .    .    p    .
 
    4    R    .    .    .    .    .    .    p
 
    3    .    .    .    .    P    .    n    P
 
    2    .    .    .    .    .    P    P    K
 
    1    .    .    .    .    .    .    .    r
 
  
Move History
 
1: Moved Pawn d2 to d4
2: Moved Pawn e7 to e6
3: Moved Knight b1 to c3
4: Moved Pawn d7 to d5
5: Moved Bishop c1 to f4
6: Moved Queen d8 to f6
7: Moved Bishop f4 to c7 and taking Pawn.
8: Moved Knight b8 to c6
9: Moved Knight g1 to f3
10: Moved Queen f6 to e7
11: Moved Bishop c7 to f4
12: Moved Queen e7 to f6
13: Moved Bishop f4 to g5
14: Moved Queen f6 to f5
15: Moved Pawn e2 to e3
16: Moved Bishop f8 to b4
17: Moved Bishop f1 to d3
18: Moved Queen f5 to g4
19: Moved King e1 to g1
20: Moved Pawn f7 to f6
21: Moved Bishop g5 to f4
22: Moved Pawn a7 to a6
23: Moved Pawn h2 to h3
24: Moved Queen g4 to h5
25: Moved Knight f3 to d2
26: Moved Queen h5 to d1 and taking Queen.
27: Moved Rook f1 to d1 and taking Queen.
28: Moved Pawn g7 to g5
29: Moved Bishop f4 to c7
30: Moved Knight g8 to h6
31: Moved Pawn a2 to a3
32: Moved Bishop b4 to c3 and taking Knight.
33: Moved Pawn b2 to c3 and taking Bishop.
34: Moved Bishop c8 to d7
35: Moved Rook d1 to b1
36: Moved Pawn b7 to b5
37: Moved Bishop c7 to d6
38: Moved King e8 to d8
39: Moved Bishop d3 to e2
40: Moved Knight h6 to f5
41: Moved Bishop d6 to c5
42: Moved Knight f5 to g7
43: Moved Bishop e2 to d3
44: Moved King d8 to c8
45: Moved Bishop c5 to d6
46: Moved Knight g7 to e8
47: Moved Bishop d6 to g3
48: Moved Pawn h7 to h5
49: Moved Bishop d3 to g6
50: Moved Pawn e6 to e5
51: Moved Pawn d4 to e5 and taking Pawn.
52: Moved Pawn h5 to h4
53: Moved Bishop g3 to h2
54: Moved Knight c6 to e5 and taking Pawn.
55: Moved Bishop h2 to e5 and taking Knight.
56: Moved Pawn f6 to e5 and taking Bishop.
57: Moved Knight d2 to f3
58: Moved Knight e8 to f6
59: Moved Knight f3 to e5 and taking Pawn.
60: Moved Bishop d7 to e6
61: Moved Knight e5 to f7
62: Moved Bishop e6 to f7 and taking Knight.
63: Moved Bishop g6 to f7 and taking Bishop.
64: Moved Rook a8 to a7
65: Moved Bishop f7 to e6
66: Moved King c8 to b8
67: Moved Rook b1 to b4
68: Moved Rook a7 to c7
69: Moved Rook b4 to b3
70: Moved Knight f6 to e4
71: Moved Bishop e6 to d5
72: Moved Knight e4 to c3 and taking Pawn.
73: Moved Bishop d5 to f3
74: Moved Rook h8 to f8
75: Moved Rook b3 to b4
76: Moved Pawn a6 to a5
77: Moved Rook b4 to g4
78: Moved Rook c7 to c5
79: Moved Rook a1 to e1
80: Moved Rook c5 to e5
81: Moved Rook g4 to d4
82: Moved Pawn a5 to a4
83: Moved Rook d4 to d3
84: Moved Rook e5 to c5
85: Moved Rook e1 to a1
86: Moved Rook c5 to c4
87: Moved Rook d3 to d7
88: Moved Pawn b5 to b4
89: Moved Rook d7 to b7
90: Moved King b8 to c8
91: Moved Pawn a3 to b4 and taking Pawn.
92: Moved Rook f8 to f3 and taking Bishop.
93: Moved Rook b7 to b6
94: Moved Rook f3 to f7
95: Moved Pawn b4 to b5
96: Moved Knight c3 to e2
97: Moved King g1 to f1
98: Moved Rook c4 to c2 and taking Pawn.
99: Moved Rook a1 to a4 and taking Pawn.
100: Moved Knight e2 to g3
101: Moved King f1 to g1
102: Moved Rook c2 to c1
103: Moved King g1 to h2
104: Moved Rook c1 to h1