Check out Atomic Chess, our featured variant for November, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Chess. Play Chess with Jocly.[All Comments] [Add Comment or Rating]
📝Michel Gutierrez wrote on Fri, Apr 22, 2016 05:16 PM UTC:
<p>I'm not sure you are taking the right approach here.</p> <p>In Chess in general and in the Jocly implementation in particular, the king has a special status and has a lot of code associated to that status. Meaning, if your game defines the Queen has being the piece to checkmate, you should treat it as the King in the implementation. Believe me, you'll save yourself a lot of troubles.</p> <p><code>cbLongRangeGraph</code> is a function to calculate once for all (it's only done at the beginning of the game) a big array to store the general movement graph for each piece type. There is no way it takes into account dynamic situations like check.</p> <p>Functions are located in <code>Board</code> or <code>Game</code> for good reasons: they don't have the same visibility of the gaming situation and attempting to move a function from one class to another will almost always fail.</p> <p>When the page stays blank, this is generally a problem with the code syntax or top level execution. You should look at the console, there is a trace saying that <code>Board is undefined</code> somewhere.</p> <p>My recommandations:<p> <ul> <li>forget about the Queen from a programming point of view: this is definitely a King</li> <li>have a look at the XiangQi implementation, there is something about preventing Kings to face each other</li> </ul>