Search found 3349 matches

by Sven
Tue Aug 04, 2020 1:00 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplifying code
Replies: 98
Views: 27685

Re: Simplifying code

I copy pasted your code in my solution. But speed got much worse. Factor two. Don't know what caused it. Oops, I guess that's because I left a little trap for you in my code snippet :lol: // NOTE: // I suggest to switch the order of "i" and "stage" in the return tuple for consistency with the // or...
by Sven
Mon Aug 03, 2020 11:17 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplifying code
Replies: 98
Views: 27685

Re: Simplifying code

[...] nested ?: at the last statement of this method are hardly readable. (IMovePrioQ, IMoveBase, int, int) NextMove( SearchParam p, IMovePrioQ prioQ, int stage, int i, bool allowStandPat) { var end = i >= prioQ.Count(); var (j, nextStage) = end ? (0, stage+1) : (i, stage); var nextPrioQ = (end && ...
by Sven
Sun Aug 02, 2020 9:57 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplifying code
Replies: 98
Views: 27685

Re: Simplifying code

The copy&make approach is not necessarily "too expensive". You could certainly optimize your implementation by using 8 bitboards instead of 13, and also by using a slightly more efficient copying technique than a loop (e.g. memcpy() in C). But in general that approach can work equally well compared ...
by Sven
Fri Jul 31, 2020 12:06 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplifying code
Replies: 98
Views: 27685

Re: Simplifying code

Looks like I'm an expert in writing horrible code. For instance this one. I mean nested ?: at the last statement of this method are hardly readable. Not the only reason ... Recursive call of NextMove()? Why? What is the purpose of variable "j"? Maybe choose a better name ... "i" can be understood f...
by Sven
Wed Jul 08, 2020 8:50 am
Forum: Computer Chess Club: Tournaments and Matches
Topic: 80th Amateur Series Division 7
Replies: 12
Views: 1612

Re: 80th Amateur Series Division 7

Hi Graham, thank you for this great tournament. I have tried to connect to GrahamCCRL.dyndns.org, Port 16001 with the Chess viewer, but I get a "Connection failed. No response from server." each time. Can you help? Thank you! Hi Oliver, connection issues are usually to do with either firewall or ro...
by Sven
Wed Jul 08, 2020 8:43 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Correct way to store and extract mate scores
Replies: 9
Views: 1784

Re: Correct way to store and extract mate scores

The typical pattern applied in many engines is as follows: - In the tree, mate scores are relative to the root node. When detecting a mate ("mated in 0") you return -(MATE_VALUE - ply). When seeing a mate score returned from a subtree you either see a negative score ("mated in N" with even N) or a p...
by Sven
Fri Jul 03, 2020 8:28 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions
Replies: 15
Views: 1694

Re: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions

Furthermore, I do not fully understand your code regarding the side to move and the viewpoint of the static evaluation. I see three terms: 1) pos.analysisPlayer, which seems to be the side to move at the root node (but why do you still need to maintain that, after having switched from minimax to neg...
by Sven
Thu Jul 02, 2020 7:58 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions
Replies: 15
Views: 1694

Re: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions

The +abm() must be correct. In Negamax you negate the result of searching a child node where it was the opponent's turn. But in mtdf() you call abm() still at root so there is nothing to negate yet. Your Negamax happens inside of abm() only. Does your static eval return a score from the viewpoint of...
by Sven
Thu Jul 02, 2020 3:03 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions
Replies: 15
Views: 1694

Re: New-ish engine coder, would appreciate if someone could look at my code and point me in the right directions

if(m.endPosition.eval > g){ tpMove[pos.hash] = m; pos.bestMove = m; g = m.endPosition.eval; } if(g > a){ a = g; tpMove[pos.hash] = m; pos.bestMove = m; } You only have a PV (and therefore a best move) if its score is within the alpha/beta window. Therefore you should only store the best move if (g ...