Moderator: Andres Valverde
Onno Garms wrote:You should tell us why you are not using the tree aproach which has proven to be powerful over decades of chess programming.
If you are just looking for a way to make your engine stronger: read about alpha-beta etc. and implement it.
Many engine authors before you have tried other aproaches than brute force tree search, with very limited success.
void NEG(int Color, int lastply)
{
char attacks[128], LVA[128];
int my_moves = msp;
int i, j, k, from, to, piece, victim, Score, BestScore, BestMove;
for(i=0; i<128; i++) { attacks[i] = 0; LVA[i] = 100; }
move_gen(Color, lastply, 1);
pseudo_gen(Color, attacks, LVA); /* count attacks */
pseudo_gen(COLOR-Color, attacks+8, LVA+8); /* count defends */
BestMove = -1; BestScore = -INF;
for(i=my_moves; i<msp; i++)
{
from = stack[i]>>8 & 0x77;
to = stack[i] & 0x77;
piece = board[from];
victim = board[to];
Score = qval[victim-WHITE];
if(attacks[to] <= attacks[to+8]) Score -= qval[piece-WHITE];
if(attacks[from+8] > attacks[from]) Score += qval[piece-WHITE]; else
if(LVA[from+8] < qval[piece-WHITE])
Score += qval[piece-WHITE] - LVA[from+8];
Score *= PVAL;
if(kind[piece-WHITE] < ROOK) /* P, N and B */
Score += CentrPts[to] - CentrPts[from];
if(piece = Color - WHITE) Score -= 50; /* King */
Score += rand()>>9 & 15;
if(Score > BestScore)
{
BestScore = Score;
BestMove = i;
}
}
RetMove = stack[BestMove];
msp = my_moves;
return;
}
[Event "Computer chess game"]
[Site "FOM-RHKA8J2A5WY"]
[Date "2007.05.27"]
[Round "-"]
[White "POS v1.14 / Mon Apr 30 22:30:29 2007"]
[Black "neg01"]
[Result "0-1"]
[TimeControl "40/300"]
1. f3 Nf6 2. c3 Nc6 3. Qa4 d5 4. Kd1 Be6 5. Kc2 g6 6. Kb3 Bg7 7. Ka3 b6 8.
Qxc6+ Kf8 9. Qa4 c5 10. Kb3 Qd7 11. Kc2 Qxa4+ 12. Kd3 c4+ 13. Kd4 Ng4#
{Black mates} 0-1
[Event "Computer chess game"]
[Site "FOM-RHKA8J2A5WY"]
[Date "2007.05.27"]
[Round "-"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8 81. h6
Rd2 82. h7+ Kxh7 83. Kc1 Rxd3 84. Kb1 Rxb3+ 85. Ka2 Rc3 86. Kb2 Rc4+ 87.
Kb3 Rc2
{Stalemate} 1/2-1/2
Folkert van Heusden wrote:Hi,
I'm developing a chess engine (in java) which is not using that algorithm of Shannon (for the evalutation of a setting) nor using any alpha-beta or any other tree. Yes, it looks only one ply deep. Ok, 2 to be able to see if it got check or so, but not more.
Now I do not have so much chess knowledge so I was wondering if there's anyone out there who would like to evaluate the playing of my chess program. I'm not looking for comments like "it sucks" or "rubbish" as I already know that myself. More like: focus on this or that, or it behaves when this or that.
It can be downloaded from: http://www.vanheusden.com/pos/
It works with xboard and should work with winboard as well altough I never really tried that.
Guenther Simon wrote:I once wrote you a bug report a while ago, but your answer was so insufficient and egozentric that I did not care to bother you again.
[Event "Computer chess game"]
[Site "FOM-RHKA8J2A5WY"]
[Date "2007.05.28"]
[Round "1.1"]
[White "Ram 0.0"]
[Black "POS 1.14"]
[Result "1-0"]
[TimeControl "300"]
[Number "19"]
1. d3 Nf6 2. f4 h6 3. h4 c6 4. c4 Qa5+ 5. Nc3 Kd8 6. a3 Na6 7. f5 Kc7 8.
Rb1 Kd6 9. e4 Ke5 10. Ra1 Kd4 11. c5 Ke5 12. d4#
{White mates} 1-0
H.G.Muller wrote:I made yet another engine: Ram 0.0. It is the 'random mover', which randomly selects a move to play from one of the legal moves (i.e. all with equal probability).
Over 50 games POS scored 75% against it. Ram was able to win a couple of games, though... Like this one:[Event "Computer chess game"]
[Site "FOM-RHKA8J2A5WY"]
[Date "2007.05.28"]
[Round "1.1"]
[White "Ram 0.0"]
[Black "POS 1.14"]
[Result "1-0"]
[TimeControl "300"]
[Number "19"]
1. d3 Nf6 2. f4 h6 3. h4 c6 4. c4 Qa5+ 5. Nc3 Kd8 6. a3 Na6 7. f5 Kc7 8.
Rb1 Kd6 9. e4 Ke5 10. Ra1 Kd4 11. c5 Ke5 12. d4#
{White mates} 1-0
And to Guenther: don't bother to spend CPU time testing NEG 0.1 or Ram! They don't support any time controls either, and always move instantly (i.e. in a few micro-seconds).
Typically it strips POS completely bare, with about 80% of its own material left.
H.G.Muller wrote:Well, POS did not lose very many games. I just noticed 2 in the first 50. Most of the score of Ram comes from 50-move draws and stalemates. Unfortunately the pgn file is not so easy to scan for checkmates by Ram, as they alternate colors. I could send you the pgn, if you wanted, but I guess you can easily test it yourself. A ramdom mover is not so difficult to make. This one was even not perfect as it doesn't do under-promotions.
Your last remark is puzzling. How could it possibly 'strategic' to do almost exclusively King moves, and position the King in the center?
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 44 guests