Komodo misses mate in 1...

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Komodo misses mate in 1...

Post by metax »

Don wrote:Hey Peter,

When are you going to start your own chess program? I think you should go ahead and try. My first program was horrible and so will yours, but that is ok - nothing prevents you from improving it as you go or scrapping it later for a rewrite.

Start with the most basic thing and go from there. Don't copy some public domain code but figure out the data structure for yourself - copying code is like using a calculator instead of first learning how to add and subtract for yourself.

Do you do any programming? If not, now is a good time to learn. Mabye by the time your are 15 or so you will have a very strong program if you start learning C now!

Don
I am about to lose my title as youngest chess programmer here in the forum... :shock: :D

;)
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Komodo misses mate in 1...

Post by Don »

metax wrote:
Don wrote:Hey Peter,

When are you going to start your own chess program? I think you should go ahead and try. My first program was horrible and so will yours, but that is ok - nothing prevents you from improving it as you go or scrapping it later for a rewrite.

Start with the most basic thing and go from there. Don't copy some public domain code but figure out the data structure for yourself - copying code is like using a calculator instead of first learning how to add and subtract for yourself.

Do you do any programming? If not, now is a good time to learn. Mabye by the time your are 15 or so you will have a very strong program if you start learning C now!

Don
I am about to lose my title as youngest chess programmer here in the forum... :shock: :D

;)
How old are you?
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Komodo misses mate in 1...

Post by metax »

Don wrote:How old are you?
15 ;)
The ration between CCRL Elo and age is 138. Anyone above this? ;)
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Komodo misses mate in 1...

Post by Don »

metax wrote:
Don wrote:Hey Peter,

When are you going to start your own chess program? I think you should go ahead and try. My first program was horrible and so will yours, but that is ok - nothing prevents you from improving it as you go or scrapping it later for a rewrite.

Start with the most basic thing and go from there. Don't copy some public domain code but figure out the data structure for yourself - copying code is like using a calculator instead of first learning how to add and subtract for yourself.

Do you do any programming? If not, now is a good time to learn. Mabye by the time your are 15 or so you will have a very strong program if you start learning C now!

Don
I am about to lose my title as youngest chess programmer here in the forum... :shock: :D

;)
When I was 15 or 16 there were no home computers. I did however "write" a paper chess program, a list of instructions that if followed correctly led to a move (with the aid of a coin flip.) The instructions basically tried to post pieces to the center and avoid blunders. I think the first "instruction" was to deliver (any) checkmate (mate in one only) if one is possible - so it did require a little bit of human skill to interpret this without error - a lot of very weak players cannot reliably find checkmating moves.

The instructions did not require sophisticated look ahead, but I think everything tactical was based on knowing what was up-attacked, and if something was defended - I did not try to take it very far because it would be increasing difficult to "execute" correctly. So it would not move into a situation where a lower valued piece could capture it or leave anything hanging outright - although it could easily be defeated with simple exchanges. Most of move logic involved avoiding blunders primarily and secondarily trying to center pieces. If I'm am remember correctly the "positional logic" was to try to center pieces in a specific order, the d and e pawns first, then knights, then bishops, then rooks and queens. So if you could play e2 to e4 or d2 to d4 that was best, then e2e3 or d2d3 etc. After that, knight moves that centered the knight more (or the most.) I had tie break rules to cover moves that were equal, but in general you played the first move that applied.

I wanted it to not be too tedious to execute and once you got the hang of it you could calculate a move pretty quickly. And it was surprisingly good when compared to the average high school kid. I could be remembering a lot of this wrong, but those were the general principles. The skill in this has more to do with how to make this simple and non-tedious. It could have been made significantly stronger with more rules, but it was not feasibly to have to spend 2 or 3 minutes figuring out each move.

For this to be fun you must be able to execute the move in a few seconds with practice.

I have often considered making up such a program, memorizing the instructions and then going to local chess tournaments with this in your head to get a rating for it! And you could improve it little by little based on your experience with it, the primary factor being that it cannot be too complicated to be unreliable.

Of course I could not do this now, as I am too strong and it would ruin my reputation as a player - not that I'm that good, but I would still be a few hundred ELO stronger than this and some of the moves produced would look so alien that even weak players would flinch.

Don
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Komodo misses mate in 1...

Post by metax »

Don wrote:When I was 15 or 16 there were no home computers. I did however "write" a paper chess program, a list of instructions that if followed correctly led to a move (with the aid of a coin flip.) The instructions basically tried to post pieces to the center and avoid blunders. I think the first "instruction" was to deliver (any) checkmate (mate in one only) if one is possible - so it did require a little bit of human skill to interpret this without error - a lot of very weak players cannot reliably find checkmating moves.

The instructions did not require sophisticated look ahead, but I think everything tactical was based on knowing what was up-attacked, and if something was defended - I did not try to take it very far because it would be increasing difficult to "execute" correctly. So it would not move into a situation where a lower valued piece could capture it or leave anything hanging outright - although it could easily be defeated with simple exchanges. Most of move logic involved avoiding blunders primarily and secondarily trying to center pieces. If I'm am remember correctly the "positional logic" was to try to center pieces in a specific order, the d and e pawns first, then knights, then bishops, then rooks and queens. So if you could play e2 to e4 or d2 to d4 that was best, then e2e3 or d2d3 etc. After that, knight moves that centered the knight more (or the most.) I had tie break rules to cover moves that were equal, but in general you played the first move that applied.

I wanted it to not be too tedious to execute and once you got the hang of it you could calculate a move pretty quickly. And it was surprisingly good when compared to the average high school kid. I could be remembering a lot of this wrong, but those were the general principles. The skill in this has more to do with how to make this simple and non-tedious. It could have been made significantly stronger with more rules, but it was not feasibly to have to spend 2 or 3 minutes figuring out each move.

For this to be fun you must be able to execute the move in a few seconds with practice.

I have often considered making up such a program, memorizing the instructions and then going to local chess tournaments with this in your head to get a rating for it! And you could improve it little by little based on your experience with it, the primary factor being that it cannot be too complicated to be unreliable.

Of course I could not do this now, as I am too strong and it would ruin my reputation as a player - not that I'm that good, but I would still be a few hundred ELO stronger than this and some of the moves produced would look so alien that even weak players would flinch.

Don
Sounds like Turing's "paper machine"... very interesting! Did it play stronger than ~1300 Elo? ;)
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Komodo misses mate in 1...

Post by Don »

metax wrote:
Don wrote:When I was 15 or 16 there were no home computers. I did however "write" a paper chess program, a list of instructions that if followed correctly led to a move (with the aid of a coin flip.) The instructions basically tried to post pieces to the center and avoid blunders. I think the first "instruction" was to deliver (any) checkmate (mate in one only) if one is possible - so it did require a little bit of human skill to interpret this without error - a lot of very weak players cannot reliably find checkmating moves.

The instructions did not require sophisticated look ahead, but I think everything tactical was based on knowing what was up-attacked, and if something was defended - I did not try to take it very far because it would be increasing difficult to "execute" correctly. So it would not move into a situation where a lower valued piece could capture it or leave anything hanging outright - although it could easily be defeated with simple exchanges. Most of move logic involved avoiding blunders primarily and secondarily trying to center pieces. If I'm am remember correctly the "positional logic" was to try to center pieces in a specific order, the d and e pawns first, then knights, then bishops, then rooks and queens. So if you could play e2 to e4 or d2 to d4 that was best, then e2e3 or d2d3 etc. After that, knight moves that centered the knight more (or the most.) I had tie break rules to cover moves that were equal, but in general you played the first move that applied.

I wanted it to not be too tedious to execute and once you got the hang of it you could calculate a move pretty quickly. And it was surprisingly good when compared to the average high school kid. I could be remembering a lot of this wrong, but those were the general principles. The skill in this has more to do with how to make this simple and non-tedious. It could have been made significantly stronger with more rules, but it was not feasibly to have to spend 2 or 3 minutes figuring out each move.

For this to be fun you must be able to execute the move in a few seconds with practice.

I have often considered making up such a program, memorizing the instructions and then going to local chess tournaments with this in your head to get a rating for it! And you could improve it little by little based on your experience with it, the primary factor being that it cannot be too complicated to be unreliable.

Of course I could not do this now, as I am too strong and it would ruin my reputation as a player - not that I'm that good, but I would still be a few hundred ELO stronger than this and some of the moves produced would look so alien that even weak players would flinch.

Don
Sounds like Turing's "paper machine"... very interesting! Did it play stronger than ~1300 Elo? ;)
Probably not, but 1300 will crush most casual players who don't know what an ELO rating is. So even if this played at 1100 I think it would have won a lot of games against typical high school kids.

I think a stronger version of this could be created that stronger players could execute by introducing the concept of "tactically sound", where this is defined by simple but concise rules but would involve analyzing exchanges and be conditioned in such a way that the answer is never ambiguious. I think most tournament players could do a swap-off analysis on a single point for instance. Imagine the type of game where white is trying to play "d4" and both black and white are "ganging up" on d4. My naive paper program cannot understand that, but it's not difficult for most players to calculate if d4 is "superficially" sound by looking at all the attacks on that square NOW. Of course checks and other captures can make this analysis wrong and it would be forbidden to take these into consideration, nevertheless I am sure this would add 200 ELO to the naive algorithm.

So the program starts with the definition:

"a move is tactically sound if ...."

And the definition is a simple swap-off subject to some rules (such as whether to consider the rule "a pinned piece does not exist") and how to deal with checks that might be part of the swap-off. It gets complicated quickly!

Perhaps we could develop a framework for a simple interpreter than can execute such programs and have a contest? Such a framework must forbid recursion of the simulation of recursion using loops, otherwise one could simple build a "real" chess program from this and the idea is something simple enough that it could be executed in your head with only a little practice.
alpha123
Posts: 660
Joined: Sat Dec 05, 2009 5:13 am
Location: Colorado, USA

Re: Komodo misses mate in 1...

Post by alpha123 »

Don wrote:
Cool. That's a neat idea.

Yeah, sounds smart. Underpromotions don't happen all that often, so limit it to like 2-4 ply to avoid missing something important but not mess anything up with branching. Actually, I suppose you could generate them, search them only at the root, examine Q promotions, and if they draw probe the hash to see if we were winning earlier, and search underpromotions in N, R, B order. Just an idea. (from a 13 year old who does about no chess programming [yet])

Peter
Hey Peter,

When are you going to start your own chess program? I think you should go ahead and try. My first program was horrible and so will yours, but that is ok - nothing prevents you from improving it as you go or scrapping it later for a rewrite.

Start with the most basic thing and go from there. Don't copy some public domain code but figure out the data structure for yourself - copying code is like using a calculator instead of first learning how to add and subtract for yourself.

Do you do any programming? If not, now is a good time to learn. Mabye by the time your are 15 or so you will have a very strong program if you start learning C now!

Don
I do programming (mostly in Java and various web stuff [PHP, Perl, JavaScript], but I do know C/C++ at some level....), and I have been doing a bit of chess programming here and there (I have a "mutilated bitboard" board representation, but no move generator).
I have read about alpha-beta quite a bit, but I'm still really kinda stuck on generating moves, legal or otherwise. So I guess I'll start sometime soon.....

Thanks for the encouragement,
Peter
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Komodo misses mate in 1...

Post by Edmund »

metax wrote:
Don wrote:How old are you?
15 ;)
The ration between CCRL Elo and age is 138. Anyone above this? ;)
You beat me; I am at 123
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Komodo misses mate in 1...

Post by metax »

Edmund wrote:
metax wrote:
Don wrote:How old are you?
15 ;)
The ration between CCRL Elo and age is 138. Anyone above this? ;)
You beat me; I am at 123
Are you 20? ;)
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Komodo misses mate in 1...

Post by Edmund »

metax wrote:
Edmund wrote:
metax wrote:
Don wrote:How old are you?
15 ;)
The ration between CCRL Elo and age is 138. Anyone above this? ;)
You beat me; I am at 123
Are you 20? ;)
well researched

I did my first computerchess-related project when I was around 16:
http://members.chello.at/cm-codeman/Chess/
It is a simple web chess gui I made in Javascript (it is only compatible with IE, not Firefox or Chrome)

The engine programming started about 2 years after that.