Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


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

Comments/Ratings for a Single Item

Later Reverse Order EarlierEarliest
Play-test applet for chess variants. Applet you can play your own variant against.[All Comments] [Add Comment or Rating]
🔔Notification on Wed, May 8 07:18 PM UTC:

The author, H. G. Muller, has updated this page.


Aurelian Florea wrote on Mon, May 6 02:52 PM UTC in reply to Fergus Duniho from Sun May 5 04:59 PM:

Acording to the rules of the game, first white has to place it's two gating pieces behind. Then black his two. I got stuck while trying to do both move in the same turn. I have tried using continuemove, but I get into infinite loops no matter what I had done.


🕸Fergus Duniho wrote on Sun, May 5 04:59 PM UTC in reply to H. G. Muller from 08:18 AM:

The only thing I am still in doubt about is whether the current betza.txt include file on which the PTA-generated code relies tests for a move being the final one in a safe and reliable way. Because it uses mln for the test rather than turn.

I have just added thismovenum and maxmovenum. These will return $mline[$mln]->movenum and $mline[$maxmln]->movenum. It's likely that maxmovenum will be returning the same value as movenum, which returns $movenum, but using it will add clarity to your code.


Aurelian Florea wrote on Sun, May 5 04:52 PM UTC in reply to Aurelian Florea from 02:25 PM:

No matter I have made some progress!


Aurelian Florea wrote on Sun, May 5 02:25 PM UTC in reply to H. G. Muller from 08:18 AM:

It is definitely not that easy.

One thing is that when I try to make the move to a1 (for example), which would be an eligible brouhaha square I get an error saying that said move it is not even a pseudo legal move. By the way for now I have disabled the brouhaha squares and left the whole board intact (meaning no ----). But I could not comment the set brouhaha instruction in the pregame code.

Another thing is that the regular moves of all pieces are still displayed despite the fact that they are not legal anymore (i have setsystem the legalmoves array to () or even to null).


💡📝H. G. Muller wrote on Sun, May 5 08:18 AM UTC in reply to Aurelian Florea from 04:32 AM:

If I understood Fergus correctly all that is needed to do it is compare the value of turn instead of mln. Like

if == 1 turn:
... // code for first prelude step
elseif == turn 2:
... // code for second prelude step
else:
  gosub HandleMove true;
  ... // code for performing the gating if needed
endif;

The only thing I am still in doubt about is whether the current betza.txt include file on which the PTA-generated code relies tests for a move being the final one in a safe and reliable way. Because it uses mln for the test rather than turn. But that would affect every preset automated through the PTA, and I have never encountered a case where it did not work.


Aurelian Florea wrote on Sun, May 5 04:32 AM UTC in reply to Fergus Duniho from Fri May 3 06:05 PM:

@Fergus & @ H.G.

So basically it can't be done yet!


🕸Fergus Duniho wrote on Fri, May 3 06:05 PM UTC in reply to H. G. Muller from 05:45 PM:

if == 0 $mline[$mln]->movenum:

That is mixing GAME Code with PHP. GAME Code does not support classes with properties or write out array elements with brackets, and it doesn't provide read access to $mline. But you can use the value of turn with your knowledge of which side you're concerned with to determine where you are in a game.


💡📝H. G. Muller wrote on Fri, May 3 05:45 PM UTC in reply to Fergus Duniho from 05:35 PM:

OK, so the betza.txt code, which thus aims to test for whether the move is the one that was just entered, would work fine even in the presence of comments?

And the code to test for whether we are in prelude should look like

if == 0 $mline[$mln]->movenum:

?


🕸Fergus Duniho wrote on Fri, May 3 05:35 PM UTC in reply to H. G. Muller from 05:20 PM:
set all == mln $maxmln;          // indicates last move

Note there is no $ there, so we might be talking about different things, and this one might be a legacy variable.

This operator just outputs the value of $mln.

I cannot image how this would work if mln was not the current move number.

It works because you are comparing mln with its maximum value. When there are comments, $maxmln will be greater than any move number, but it will be no higher than mln will eventually reach.


💡📝H. G. Muller wrote on Fri, May 3 05:20 PM UTC in reply to Fergus Duniho from 04:59 PM:

It does not. I have made that mistake too and had to correct it. To use $mln to get the move number, you need to get $mline[$mln]->movenum.

This is somewhat important, because the first things that the HandleMove routine does in the betza.txt include after the move is parsed is:

  set all == mln $maxmln;          // indicates last move

Note there is no $ there, so we might be talking about different things, and this one might be a legacy variable. The purpose here is to determine whether the subsequent move generation needs to generate all pseudo-legal moves, and compare the input move against those for testing its legality. Or whether it can simply assume the move is legal, because it is not the final move of the stored game, and thus must already have passed the legality test on the turn where it was entered. If the latter is the case only the moves with implied side effects are generated, (e.g. e.p. capture or castling), for the purpose of reconstructing the side effect, and apply it to the board together with the entered move.

I cannot image how this would work if mln was not the current move number.


🕸Fergus Duniho wrote on Fri, May 3 04:59 PM UTC in reply to H. G. Muller from 08:55 AM:

I think the variable 'mln' gives you the current move number in the Post-Move sections.

It does not. I have made that mistake too and had to correct it. To use $mln to get the move number, you need to get $mline[$mln]->movenum. $mline is an array with a separate entry for each line of the movelist, but besides containing actual moves, it contains comments. $mln is the index that a line has in this array, but when some lines are comments, it will go out of sync with the move number.

GAME Code has turn, which will return $mline[$mln]->turn, but it doesn't currently have anything returning $mline[$mln]->movenum.


catugo wrote on Fri, May 3 09:02 AM UTC in reply to H. G. Muller from 08:55 AM:

Thanks, I look into it soon!


💡📝H. G. Muller wrote on Fri, May 3 08:55 AM UTC in reply to Aurelian Florea from Thu May 2 12:37 PM:

But some hints to where I put my code and what that code should be are very welcomed.

I think the variable 'mln' gives you the current move number in the Post-Move sections. What you want is special treatment for the first few ('prelude') moves, and then the normal procedure possibly followed by gating when this would be required. So something like:

if == mln 0:
  ... // do what has to be done for the first prelude turn
elsif == mln 2:
  ... // do what has to be done for the third prelude turn
else:
  gosub HandleMove true;
  set waiting where #ori 0 -1; // square behind moved piece
  if not flag #ori and == 1 rank #ori != @ space #waiting: // virgin first-rank piece with something behind it
    add space #waiting #ori; // gate the piece
    empty #waiting;
  endif;
endif;

You stil would have to suppress normal moves for the pieces waiting to be gated. I suppose the easiest way to do this define an alternative version of those that looks the same but does not have any moves, and put those on 0th rank. When its turn comes to be gated you then put the version with moves on the board.


Aurelian Florea wrote on Thu, May 2 12:37 PM UTC in reply to Aurelian Florea from Wed May 1 04:46 PM:

@HG Muller & @Fergus Duniho

I have looked through the musketeer chess preset and recapped a bit of the programmer's guide. I have also tried a few things. But still I have no true clue on how to do the gating. Any help with clues is welcomed. Don't bother too much though. I know you guys are busy. But some hints to where I put my code and what that code should be are very welcomed.


Aurelian Florea wrote on Wed, May 1 04:46 PM UTC in reply to H. G. Muller from 07:18 AM:

Very little succes s far though. This is what I have so far:

https://www.chessvariants.com/play/pbm/play.php?game%3DFrog+Chess+with+Gryphon+and+Falcon%26settings%3Ddefault


catugo wrote on Wed, May 1 07:34 AM UTC in reply to H. G. Muller from 07:18 AM:

Indeed!


💡📝H. G. Muller wrote on Wed, May 1 07:18 AM UTC in reply to Aurelian Florea from 06:17 AM:

I have just read that thismove does not work in premove

All the more reason to not do anything there.


Aurelian Florea wrote on Wed, May 1 06:17 AM UTC in reply to H. G. Muller from 06:15 AM:

I have just read that thismove does not work in premove


💡📝H. G. Muller wrote on Wed, May 1 06:15 AM UTC in reply to Aurelian Florea from 01:43 AM:

I am not sure it would ever make sense to add code in the Pre-Move section, when you automate through the PTA. Because Game Courier is configured to "not add moves" in that case, you should be in the same state at the start of the Post-Move section as you are in Pre-Move.


Aurelian Florea wrote on Wed, May 1 01:43 AM UTC in reply to Aurelian Florea from 01:34 AM:

Not it. I can write some echo there!


Aurelian Florea wrote on Wed, May 1 01:34 AM UTC in reply to H. G. Muller from Tue Apr 30 08:04 PM:

It seems I cannot add code to the premove section!


Aurelian Florea wrote on Wed, May 1 12:27 AM UTC in reply to Daniel Zacharias from Tue Apr 30 09:27 PM:

That thought has crossed my mind, too. Thanks!


Aurelian Florea wrote on Wed, May 1 12:27 AM UTC in reply to H. G. Muller from Tue Apr 30 08:04 PM:

I was afraid of that but it makes sense.


Daniel Zacharias wrote on Tue, Apr 30 09:27 PM UTC in reply to Aurelian Florea from 04:39 PM:

You could copy the relevant parts from musketeer chess


25 comments displayed

Later Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.