Check out Modern Chess, our featured variant for January, 2025.

Enter Your Reply

The Comment You're Replying To
H. G. Muller wrote on Sun, Feb 18, 2024 08:22 PM UTC in reply to François Houdebert from 05:06 PM:

I did some experiments with the search mode in Tenjiku Shogi. The test position was basically that after 1.P-j6 (except that I first did two Leopard moves to get it out of book). At level 'medium' it would normally see the mate threat, and play 1... SE-n11.

First I disabled legality testing altogether. Then it doesn't defend against the mate threat, and even after 2.VGo10# it plays on, and only conceeds after I capture the King. Not good. This could have been expected; King capture occurs two ply after checkmate, and GenerateMoves already tests for it when it discovers there are no legal moves. I moved the testing for missing King from the Evaluation (which would make it to be discovered only after the King capture was played) to the move generation, where it declares a win if a move is generated that captures a King. That did still not make it see the mate threat at this level.

Now chess games in general are not won because you see checkmate from a larger distance, but by gaining so much material that the opponent cannot see checkmate no matter how deep he searches, as he is too weak to inflict it, so that sooner or later you will stumble into one. But Tenjiku Shogi is sort of an exception to this, with these jumping generals that threaten mate even on a full board.

So I tried something else: test the pseudo-legal moves for legality until you find a legal one, then accept all others without testing. This way you will always discover it when you are (check or stale)mated. But in the common case (where you are not, and not even in check) the very first move you generate is already very likely legal, so that you on average will hardly subject more than a single move to this check test.

Unfortunately it still did not defend against the mate threat after this. But when I execute the mate though 2.VG-10o#, it claims a draw. Turns out that in the place where it tries the moves with cbQuickApply, to test them for legality, it also tests whether those that turn out to be legal do deliver check. It stores that in the move, and when the move is played to create a new position, it takes its in-check info from there. So by skipping this for most moves it would not know anymore that it is in check, and thus judges that the situation without legal moves is a stalemate. (And apparently I forgot to let it know that in Tenjuku stalemate is a win too.) It is thus hardly amazing that it doesn't worry about that; draw with gote is a good result.

So in the code for deriving the game result when there are zero legal moves I let it do a check test if the in-check status was still undefined. That solved it: it plays 1... SE-n11 again.

But that it doesn't check all moves for legality means that it will also highlight the illegal moves at game level, except when by coincidence it was the first move that was generated (or in any case not preceded by any legal moves). This allows you to step into check, or stay in check. (Unless you are already checkmated through moves that its check test understands. Then it declares game end and you cannot move anything at all.) In Tenjiku Shogi this would of course be allowed, and improves the uniformity of the highlighting, as you were already allowed to step into checks that the check test was blind to (burning and capture by an area move).

What is a bit odd is that when you do step into check, it declares game end, without actually performing the King capture (or allowing you to do it, in case you win).


Edit Form

Comment on the page Play Chess Variants with Jocly

Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Avoid Inflammatory Comments
If you are feeling anger, keep it to yourself until you calm down. Avoid insulting, blaming, or attacking someone you are angry with. Focus criticisms on ideas rather than people, and understand that criticisms of your ideas are not personal attacks and do not justify an inflammatory response.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.