The Chess Variant Pages
Custom Search



Enter Your Reply

The Comment You're Replying To
H. G. Muller wrote on 2019-11-24 UTC

@Fergus: I definitely agree that for having sufficient generality it is necessary to be able to resort to some Turing-complete programming language. But a quite large fraction of CVs would not do anything that is not standard (in the sense that hundreds of other CVs would not do exactly the same). If exposing those who want to create presets to the code for such standard tasks discourages them, it would be better not to do that. And it would not be that difficult to achieve that.

One solution could be to reserve the code edits in the preset Edit form only for enforcing / implementing non-standard rules (and perhaps show them only on request, after ticking a checkbox that you want them). And have the code for the very common tasks, such as forbidding capture of own pieces, testing for check / stalemate / checkmate, 50-move draw, repetition draw be added automatically when the user requests this through ticking a checkbox, (e.g. "can expose royal to capture") selecting from a drop-down menu (e.g. "stalemating the opponent wins / draws / loses / is ignored") or typing a number in an otherwise empty text entry (e.g. declare draw when the same position is repeated .... times"). Untouched squares can be remembered for the entire board as a standard action of the basic system; this never hurts, and castling or special rules that require virginity could use them or ignore them as they want.

Most of the time the user would simply select the rules he wants from the combo-boxes, and never have to see the code this results in. The initial settings of these controls on creation of an entirely new preset could be those of normal Chess, so that in most cases the user would not even have to change them, but can just click 'OK' after having selected board and pieces. Only when a rule is not covered by a standard option (e.g. the counting rules for Makruk instead of the usual 50-move rule) the user would have to provide his own code for it, after deselecting the standard rule.

A simpler way to implement this would be to defer all handling of the standard rules such as mate testing to the basic system, but make its execution there conditional, subject to flags or numeric variables. The rule selection of the user would then only have to result in setting of those variables to the selected value at the start of the game.

Note that when I talk about 'default' code I don't mean code that would always be present or run unconditionally, but code that would be added / enabled unless the user decides he wants to provide something different. Where he should always have the option of having that something be nothing. Just allow exposing to check, capture of your own pieces, ignore mates, never declare draw etc. A non-rule-enforcing preset is the same as a rule-enforcing preset for a game without rules...


Edit Form

Comment on the page Games on Game Courier page

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.

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.