Nowdays i tend to be skeptical of many chess programs, particularly the ever increasing new ones, as many seem to be over 2500 starting out. I've heard from some the complaint that why should i reinvent the wheel. Software is about leveraging existing classes methods functions in order to then build on that. There is however a certain charm in coding from scratch.
the other night i was on fics and a fellow wanted someone to play his chess computer. It was a new program and he had a lot of work to do he said. I suggested he put it on as a guest and I would play it.
Apparently it got depth 4, min max only not alpha beta. not sure how he handled the quiescent issue. It did not know to castle and failed to take a piece that would have doubled my pawns so perhaps no pawn knowledge. I could sense however that his calculating was sharp and accurate just no positional knoweledge.
I let it eat 2 or 3 pawns as i moved my 2 rooks and queen into position to attack its king which was in the center and had advanced pawns surrounding it. With this tactic i got checkmate. the pgn is in my fics history i believe and when i'm logged in i'll try to get it.
After the game we chatted and i tried to encourage him to focus on the evaluate. Some simple knowledge would go a long way. For example a castle bonus, a sense of trying to keep its king behind pawns and not advancing pawns in front of king. perhaps some mobility bonsues, not sure what he was doing there, but these can at first be done simply with arrays. and of course some pawn counting.
Its fun when you see someone contend with all the issues that really go into making a computer play chess. this fun is rather absent in the cloning model.
Mike
A bit unusual - chess program from scratch
Moderator: Ras
-
- Posts: 626
- Joined: Sun May 13, 2007 9:55 pm
- Location: Bay Area, CA USA
- Full name: Mike Adams
-
- Posts: 295
- Joined: Wed Mar 08, 2006 8:29 pm
Re: A bit unusual - chess program from scratch
Yep, that's the right thing! Much more fun to begin from scratch in my opinion.
Some of the first (and worst) games of my engine were played in the engine room on the chessbase server. Most games were rather short as my weak engine had no chance against all those strong engines playing there of course.
But I also discovered some hidden bugs in my engine. My favorite bug showed up when playing a game vs Deep Fritz 7, my king was in check but my engine simply ignored that and checked the opponent as well
Roman
Some of the first (and worst) games of my engine were played in the engine room on the chessbase server. Most games were rather short as my weak engine had no chance against all those strong engines playing there of course.
But I also discovered some hidden bugs in my engine. My favorite bug showed up when playing a game vs Deep Fritz 7, my king was in check but my engine simply ignored that and checked the opponent as well

Roman
-
- Posts: 3026
- Joined: Wed Mar 08, 2006 9:57 pm
- Location: Rio de Janeiro, Brazil
Re: A bit unusual - chess program from scratch
There is a well-known story about something similar. A club in England was to meet another club in a team event. Unfortunately, not only was one of the players sick and unable to appear, but so was the reserve. The rules were clear that if a player were missing, the entire team would forfeit, so both he and the club director decided that desperate situations required desperate measures. They grabbed a guy from the local pub, paid him to appear, and 5 feverish minutes prior to the event, explained the rules as quickly as possible and stuck him on last board.Roman Hartmann wrote:Yep, that's the right thing! Much more fun to begin from scratch in my opinion.
Some of the first (and worst) games of my engine were played in the engine room on the chessbase server. Most games were rather short as my weak engine had no chance against all those strong engines playing there of course.
But I also discovered some hidden bugs in my engine. My favorite bug showed up when playing a game vs Deep Fritz 7, my king was in check but my engine simply ignored that and checked the opponent as well
Roman
3-4 hours into the match, the final board finished and the match was a tie. No one had even bothered looking at the last board, expecting the obvious, but both players were bent over, deep in concentration. The captains of both teams headed over to see how things were going and were shocked to find both the white and black kings captured and long gone from the board! As it turned out, the other team had run into an almost identical situation and had done exactly same thing....



"Tactics are the bricks and sticks that make up a game, but positional play is the architectural blueprint."
-
- Posts: 6401
- Joined: Thu Mar 09, 2006 8:30 pm
- Location: Chicago, Illinois, USA
Re: A bit unusual - chess program from scratch
I cannot describe the happiness I had when I finally hooked a winboard protocol (~year 2000) to my primitive engine and I actually played a complete game with winboard. No crashes, no problems... just a little weak naive engine. In fact, it was more than just a happy moment, it was almost a religious experience.adams161 wrote:Nowdays i tend to be skeptical of many chess programs, particularly the ever increasing new ones, as many seem to be over 2500 starting out. I've heard from some the complaint that why should i reinvent the wheel. Software is about leveraging existing classes methods functions in order to then build on that. There is however a certain charm in coding from scratch.
the other night i was on fics and a fellow wanted someone to play his chess computer. It was a new program and he had a lot of work to do he said. I suggested he put it on as a guest and I would play it.
Apparently it got depth 4, min max only not alpha beta. not sure how he handled the quiescent issue. It did not know to castle and failed to take a piece that would have doubled my pawns so perhaps no pawn knowledge. I could sense however that his calculating was sharp and accurate just no positional knoweledge.
I let it eat 2 or 3 pawns as i moved my 2 rooks and queen into position to attack its king which was in the center and had advanced pawns surrounding it. With this tactic i got checkmate. the pgn is in my fics history i believe and when i'm logged in i'll try to get it.
After the game we chatted and i tried to encourage him to focus on the evaluate. Some simple knowledge would go a long way. For example a castle bonus, a sense of trying to keep its king behind pawns and not advancing pawns in front of king. perhaps some mobility bonsues, not sure what he was doing there, but these can at first be done simply with arrays. and of course some pawn counting.
Its fun when you see someone contend with all the issues that really go into making a computer play chess. this fun is rather absent in the cloning model.
Mike
Miguel
-
- Posts: 1398
- Joined: Wed Mar 08, 2006 10:15 pm
- Location: San Francisco, California
Re: A bit unusual - chess program from scratch
My personal experience was the same. It felt really good to know that my engine was strong enough to beat me (although that's not much of an accomplishment in hindsight) but also (and even more important) stable enough to release to the public.michiguel wrote:I cannot describe the happiness I had when I finally hooked a winboard protocol (~year 2000) to my primitive engine and I actually played a complete game with winboard. No crashes, no problems... just a little weak naive engine. In fact, it was more than just a happy moment, it was almost a religious experience.adams161 wrote:Nowdays i tend to be skeptical of many chess programs, particularly the ever increasing new ones, as many seem to be over 2500 starting out. I've heard from some the complaint that why should i reinvent the wheel. Software is about leveraging existing classes methods functions in order to then build on that. There is however a certain charm in coding from scratch.
the other night i was on fics and a fellow wanted someone to play his chess computer. It was a new program and he had a lot of work to do he said. I suggested he put it on as a guest and I would play it.
Apparently it got depth 4, min max only not alpha beta. not sure how he handled the quiescent issue. It did not know to castle and failed to take a piece that would have doubled my pawns so perhaps no pawn knowledge. I could sense however that his calculating was sharp and accurate just no positional knoweledge.
I let it eat 2 or 3 pawns as i moved my 2 rooks and queen into position to attack its king which was in the center and had advanced pawns surrounding it. With this tactic i got checkmate. the pgn is in my fics history i believe and when i'm logged in i'll try to get it.
After the game we chatted and i tried to encourage him to focus on the evaluate. Some simple knowledge would go a long way. For example a castle bonus, a sense of trying to keep its king behind pawns and not advancing pawns in front of king. perhaps some mobility bonsues, not sure what he was doing there, but these can at first be done simply with arrays. and of course some pawn counting.
Its fun when you see someone contend with all the issues that really go into making a computer play chess. this fun is rather absent in the cloning model.
Mike
Miguel
Almost all of the code in Myrddin is my own, with the exception of the move generator (which is from Chessmaster, which I worked on for several years anyway) and the opening book (Myrddin uses ProDeo, but I hope to write my own some day). I have since improved the move generator so it is about 30% faster.
While of course it is extremely difficult (and some might say masochistic) to try to write a chess program without using any other source code, anybody who does it deserves an unbelievable amount of credit.
But even though about 15% of the code in Myrddin was not written by me, it still feels good to know that I didn't just start with somebody else's work, randomly poke at it until it was 20 ELO better and then announce my "creation".
jm
-
- Posts: 626
- Joined: Sun May 13, 2007 9:55 pm
- Location: Bay Area, CA USA
- Full name: Mike Adams
Re: A bit unusual - chess program from scratch
Here is the pgn of the game with the brand new chess program, made from scratch, that i got to play. It seemed to be accurate tactically within its horizon, i think he said it got depth 4, but lacked such things as a castle bonus. Was a fun game. My own experience in the weaknesses in my program when i first made it, guided how i played against it.
[Event "FICS unrated standard game"]
[Site "FICS, San Jose, California USA"]
[Date "2010.02.17"]
[Time "00:14:52"]
[Round "-"]
[White "adammr"]
[Black "GuestCDBC"]
[WhiteElo "1634"]
[BlackElo "-"]
[TimeControl "900+0"]
[Mode "ICS"]
[Result "1-0"]
1. e4 e6 2. d4 Bb4+ 3. Nc3 Qf6 4. Nf3 d6 5. e5 dxe5 6. dxe5 Qe7 7. Bg5 f6
8. exf6 gxf6 9. Bh4 Nc6 10. Bb5 Qc5 11. Bxc6+ Qxc6 12. O-O Bxc3 13. bxc3
Qxc3 14. Re1 Qc4 15. Rb1 Qxa2 16. Rb3 e5 17. Nxe5 fxe5 18. Rxe5+ Kf7 19. Rf3+
Nf6 20. Rxf6+ Kg7 21. Re7+ Qf7 22. Rexf7+
{Black resigns} 1-0
Mike
[Event "FICS unrated standard game"]
[Site "FICS, San Jose, California USA"]
[Date "2010.02.17"]
[Time "00:14:52"]
[Round "-"]
[White "adammr"]
[Black "GuestCDBC"]
[WhiteElo "1634"]
[BlackElo "-"]
[TimeControl "900+0"]
[Mode "ICS"]
[Result "1-0"]
1. e4 e6 2. d4 Bb4+ 3. Nc3 Qf6 4. Nf3 d6 5. e5 dxe5 6. dxe5 Qe7 7. Bg5 f6
8. exf6 gxf6 9. Bh4 Nc6 10. Bb5 Qc5 11. Bxc6+ Qxc6 12. O-O Bxc3 13. bxc3
Qxc3 14. Re1 Qc4 15. Rb1 Qxa2 16. Rb3 e5 17. Nxe5 fxe5 18. Rxe5+ Kf7 19. Rf3+
Nf6 20. Rxf6+ Kg7 21. Re7+ Qf7 22. Rexf7+
{Black resigns} 1-0
Mike
-
- Posts: 498
- Joined: Wed Mar 08, 2006 9:45 pm
- Location: Portland, OR
Re: A bit unusual - chess program from scratch
Oh yeah. I just finished directing a grade school tournament and saw this kind of situation a lot. In one game I was called over to confirm a result to find *both* kings checkmated! In the end, the result which made the most sense was to give the loss to the player who was in triple-checkmate!Albert Silver wrote:There is a well-known story about something similar. A club in England was to meet another club in a team event. Unfortunately, not only was one of the players sick and unable to appear, but so was the reserve. The rules were clear that if a player were missing, the entire team would forfeit, so both he and the club director decided that desperate situations required desperate measures. They grabbed a guy from the local pub, paid him to appear, and 5 feverish minutes prior to the event, explained the rules as quickly as possible and stuck him on last board.Roman Hartmann wrote:Yep, that's the right thing! Much more fun to begin from scratch in my opinion.
Some of the first (and worst) games of my engine were played in the engine room on the chessbase server. Most games were rather short as my weak engine had no chance against all those strong engines playing there of course.
But I also discovered some hidden bugs in my engine. My favorite bug showed up when playing a game vs Deep Fritz 7, my king was in check but my engine simply ignored that and checked the opponent as well
Roman
3-4 hours into the match, the final board finished and the match was a tie. No one had even bothered looking at the last board, expecting the obvious, but both players were bent over, deep in concentration. The captains of both teams headed over to see how things were going and were shocked to find both the white and black kings captured and long gone from the board! As it turned out, the other team had run into an almost identical situation and had done exactly same thing....![]()
![]()
Ian