Comments/Ratings for a Single Item

Sure, I understood that these were lines not generated by the applet in an attempt to implement Bishop Conversion. But when BBB, WWW and BWBWBW are not defined, it will return an undefined value. Which is going to give trouble if it is used as an index in the legdefs array.
I see no 'set WWW ...' in the PreGame code anywhere. And I also don't see what it would have to be set too, because there isn't any pure Bishop definition in the legdefs array at all.
[Edit] Well, they would not have to be set to anything; that would only have effect when they were used in the function as #WWW etc. They should just be replaced by the appropriate number. Perhaps you could use use the current legdef table, because it does contain the moves of the BW compound with the W moves only as initial moves. So it could also be used for a non-virgin Bishop. So BBB and BWBWBW should both be 104. And the Wazir moves come at the end of that, so a pure Wazir can be obtained by just using the 4 last moves of the compound, which start 20 places later. So WWW should be replaced by 124.
In the context of Cetina Random Chess there still is a problem, though (from which the Diagram I made also suffers): it always applies the conversion rule, also when the shuffling puts the Bishops on different shades to begin with. It would then still insist one of those started as a Wazir. So it would be necessary to detect whether the Bishops ended on equal or different shade by the shuffling.
[Edit2] OK, I found a solution to the shuffle problem. At the end of the PreGame section, add the code
set b1 findpiece B first spaces; set b2 findpiece B last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif; set b1 findpiece b first spaces; set b2 findpiece b last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif;
This will mark both Bishops as non-virgin in the starting position when their distance is an odd number of squares (i.e. when they are already on different shades). And non-virgin Bishops can never use the Wazir move.
OK, I found a solution to the shuffle problem. At the end of the PreGame section, add the code
set b1 findpiece B first spaces; set b2 findpiece B last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif; set b1 findpiece b first spaces; set b2 findpiece b last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif;This will mark both Bishops as non-virgin in the starting position when their distance is an odd number of squares (i.e. when they are already on different shades). And non-virgin Bishops can never use the Wazir move.
Something is still wrong since after adding that code I get a blank page saying only
Please report any bugs or errors to H.G. Muller
I am doing the tests with two settings names:
asymmetric-enforced does not have the code you pointed out added.
Asymmetric-Enforced does have added the code.
Both have functions B, b defined as
def B cond #0 104 0;
def b cond #0 104 0;
What are we going to do with the following lines?
def B cond #0 (cond flag var ori BBB cond == 1 var wstart BBB cond var wstart WWW BWBWBW) 0;
def b cond #0 (cond flag var ori BBB cond == 1 var bstart BBB cond var bstart WWW BWBWBW) 0;
Will we not use them?

Well the error is not a proper error page; there is no link to go to the editor for debugging the preset. It seems that the GAME-code interpreter chokes on the word first in the findpiece command. This can be a problem caused by the server switch; perhaps Fergus can look into it?
What are we going to do with the following lines?
def B cond #0 (cond flag var ori BBB cond == 1 var wstart BBB cond var wstart WWW BWBWBW) 0;
def b cond #0 (cond flag var ori BBB cond == 1 var bstart BBB cond var bstart WWW BWBWBW) 0;
Will we not use them?
We must certainly use them. But you should replace the BBB, WWW and BWBWBW by 104 and 124, (the index of the definitions of Bishop and Wazir in legdefs) as was originally instructed.
Okay. I have changed, in the two presets that I am using for testings, the definitions of B and b according to your instructions, being like this:
def B cond #0 (cond flag var ori 104 cond == 1 var wstart 104 cond var wstart 124 104) 0;
def b cond #0 (cond flag var ori 104 cond == 1 var bstart 104 cond var bstart 124 104) 0;
I repeat the links to the mentioned presets:
asymmetric-enforced does not have the code you pointed out added; it isn't broken but the conversion rule is not fully fulfilled.
Asymmetric-Enforced does have added the code but it's broken.
I wish Fergus could take a look at this matter.
I wish Fergus could take a look at this matter.
I will leave matters concerning H. G.'s automatically generated code to him unless he has an issue he needs my help with. I am not versed in the kind of code that is generated. What I will mainly help with is people who are programming in the GAME Code language on their own without the use of automatically generated code.

I will leave matters concerning H. G.'s automatically generated code to him unless he has an issue he needs my help with. I am not versed in the kind of code that is generated. What I will mainly help with is people who are programming in the GAME Code language on their own without the use of automatically generated code.
The point is that you have broken the GAME-code interpreter, so that it hangs (without producing a proper error page) on a program that contains nothing other than the statement
set b1 findpiece B first spaces;
We would appreciate it if you at least took the responsability to see to it that GAME code functions work as advertized...
Is possibile to add a commando into the code for randomize the pieces of every board like chess960?
The point is that you have broken the GAME-code interpreter, so that it hangs (without producing a proper error page) on a program that contains nothing other than the statement
set b1 findpiece B first spaces;
This is the first time this has been brought to my attention, and I have now fixed it. I also fixed the problem with just entering "set b1 findpiece B".
We would appreciate it if you at least took the responsability to see to it that GAME code functions work as advertized...
I do that regularly, but I do require that bugs be clearly brought to my attention. I skim or skip over many comments that are not directed at me.
Now that the Asymmetric-Enforced preset is accessible, it seems that the added code
set b1 findpiece B first spaces; set b2 findpiece B last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif; set b1 findpiece b first spaces; set b2 findpiece b last spaces; if & 1 - file b1 file b2: setflag #b1; setflag #b2; endif;
is not having an effect since the conversion rule is not fulfilled. I await further instructions.

Ah, I see that I forgot the # that GAME code requires to access variables in a few places. The extra Pre-Game code should really be:
set b1 findpiece B first spaces; set b2 findpiece B last spaces; if & 1 - file #b1 file #b2: setflag #b1; setflag #b2; endif; set b1 findpiece b first spaces; set b2 findpiece b last spaces; if & 1 - file #b1 file #b2: setflag #b1; setflag #b2; endif;
This does fix the case where the Bishops already start on different shade, by setting them non-virgin so that their Wazir moves are suppressed.
But I was a bit too optimistic about the other case: it does hurt that you did not define a 'pure' Bishop amongst the piece types. Because when the Bishops are on the same shade, and you move the first one as a Wazir, the second one must be forced to move as a Bishop. But it is still virgin, so the move definition of the combi piece cannot be used for it. (It can be used as the definition of a pure Wazir, because it has the W moves after the B moves, so that you can give 124 as start index of the move list instead of 104 to skip the B moves.)
From the point we are now I guess the easiest way is to add the pure Bishop to the list by hand, making the end of the legdefs array look like
2 99 -1 1 1 99 -1 0 32771 0 1 99 1 1 3 // pure bishop(598) 1 99 1 -1 3 1 99 -1 -1 3 1 99 -1 1 3 0);
(5 lines inserted). The B and b functions then should refer to this pure Bishop when it needs one:
def B cond #0 (cond flag var ori 598 cond == 1 var wstart 598 cond var wstart 124 104) 0; def b cond #0 (cond flag var ori 598 cond == 1 var bstart 598 cond var bstart 124 104) 0; This then seems to do it.

Mirko Mirko wrote on 2022-10-28 UTC
Is possibile to add a commando into the code for randomize the pieces of every board like chess960?
Yes, this is what the shuffle parameter does. For Chess960 you would say shuffle=KQR!BN , where the ! in front of the B indicates that the shuffle should keep the Bishops on different shade. All pieces mentioned in the shuffle parameter will be randomly placed in the set of squares they originally occupied. More complex restrictions of the shuffle can often be implemented by specifying several shuffles in a row (separated by a comma). For a complete explanation see the article on Interactive Diagrams, section 'Shuffle Games'.
I think I made the adjustments you indicated correctly, however something must be wrong since the bishops lost the W option when they start on squares of the same color. It strangely happens that after moving one of them, the other can no longer be moved at all.

OK, I discovered the same. The highlighting is broken. The problem is that in the method I programmed the virginity of the Bishop is determined from the origin square (var ori). That is correct for checking the legality of the move. But not when highlighting, because possible moves for white are highlighted after the black move is made. And at that time var ori holds the origin of the black move. So instead of testing the virginity of the white Bishop it highlights the moves of, it tests whether the last-moved opponent piece was virgin! (Of course this sometimes does give the correct result, when that previously moved piece happens to have the same virginity as the Bishop.)
I now made a tiny change in the included betza.txt file to make the origin square of the piece for which moves are generated already available to the B and b functions as var ss. The two functions can then use that instead of var ori, by changing those to:
def B cond #0 (cond flag var ss 598 cond == 1 var wstart 598 cond var wstart 124 104) 0; def b cond #0 (cond flag var ss 598 cond == 1 var bstart 598 cond var bstart 124 104) 0;
Thank you :)
Problem solved. Thank you so much for everything. Thanks also to Fergus for his collaboration. In practice I will use the preset under the name Cetran Chess 1 as it is the first step in a series of variants conceived according to the basic idea of increasing the complexity of the game each time.
Is possibile to add the classic pawn promotion on the last rank for the shogi pawn piece? I try to set a Q promotion with us but seems doesn't work...
I noticed that the play-test applet drag & drop table in mobile devices support the placement of only the first 7 pieces in the index (the first 6 pawn and 1 knight)
Exept in the manual setup via html edit.
@H.G. Muller Hi, I notice a mistake: in a mobile Browser is not possible to create holes on the chess board whit the specific commando.

It is not only failing to make holes on mobile browsers, but it also doesn't work on my PC. It appears the change I made in the general script to allow triple capture of the Lion Dog in the large Shogi variants collides with the way I implemented the creation of holes on the applet page. (With as a consequence that it tries to interpret the dropping of a hole as a triple capture for which it has to generate a move, which then unfortunately involves off-board squares that make it crash.)
I tried to fix it, but it seems any editing I do of this page destroys the operation of the applet: a lot of pieces, including the Kings, suddenly disappear from the selection list. So I reinstated the old version now. So that at least the applet should work as before, albeit still without the possibility to create holes. I will think on whether I can solve this hole-creation problem in the general script for interactive diagrams, without editing the applet page.

@H.G. Muller Hi, I notice a mistake: in a mobile Browser is not possible to create holes on the chess board whit the specific commando.
This is a bit difficult to fix on the short term, because the applet page cannot be edited without destroying it, and the general Diagram script it uses is cached on CloudFlare so that it cannot see any changes that are made in that. I put an improved version of the general script on the CVP website, which I expect to fix the problem, but we would have to wait until that appears in the CloudFlare cache so that it will actually be used.
In the mean time, when you want a Diagram with holes, you can just edit those into the Diagram description when you post that elsewhere; just add a line
hole::::e4,e5,d4,d5
before the line that defines the Pawn if you want holes on e4, e5, d4 and d5, etc.
Ok, no problem :)

Dear respected h.g.muller, how to express a non-crossing-pawns elephant? we know "A " indicates the elephant that can reach pieces behind pawns. but how to express the same track, but not able to cross pawns? Thanks so much. sincerely yours adella.
Dear respected h.g.muller, how to express a non-crossing-pawns elephant? we
know "A " indicates the elephant that can reach pieces behind pawns. but how to express the same track, but not able to cross pawns? Thanks so much. sincerely yours adella.

A non-jumping move to the second square diagonally would be nA.
25 comments displayed
Permalink to the exact comments currently displayed.
I copied and pasted those lines from the following paragraph taken from A Wizard for Game-Code Generation: