Comments by j_carrillo_vii
Thanks for your response and the new functions Fergus.
To keep things simple (I'm an old programmer, not too familiar with the lambda terminology), I just want four replacement functions (that I can use as black boxes) for the existing ones, so that I can do minimal changes to the presets.
Can I use this definition for the new functions I'm looking for?
def onlyupper2 filter lambda (regmatch "/[A-Z]/" #1) pieces
def onlylower2 filter lambda (regmatch "/[a-z]/" #1) pieces
def isupper2 regmatch "/[A-Z]/" #0
def islower2 regmatch "/[a-z]/" #0
Thanks for your help.
store;
local from piece to;
def friends filter lambda (regmatch "/[A-Z]/" #1) pieces;
def nofriends noupper;
def friend isupper #0;
else:
def friends filter lambda (regmatch "/[a-z]/" #1) pieces;
def nofriends nolower;
def friend islower #0;
endif;
def checked any lambda . . . . "fn space #0 #0 " #0 " unless samecase space #0 space " #0 spaces;
sub checked king:
my from piece;
if isupper cond empty #king moved space #king:
def enemies filter lambda (regmatch "/[a-z]/"Â #1) pieces;
else:
def enemies filter lambda (regmatch "/[A-Z]/" #1) pieces;
endif;
for (from piece) fn enemies:
if fn #piece #from #king:
return #from;
endif;
next;
return false;
endsub;
Thanks Fergus.
How about samecase?
I was just updating my previous comment.
OK, thanks for the clarification.
But I give up. I'm following your suggestions, but the results are still not as expected.
Let me know when you entertain to create new onlyupper, onlylower, isupper and islower functions that only consider the first character; and I will try to update the presets again.
OK, Thanks.
Having said that, not being able to do what I was trying to do for Makruk takes away the ability for players to develop automated presets for variants that may use these non-totally-alpha pieces. (P180, b180, etc.)
Right now the curent set of functions just do not easily support writing rules for presets that mix pieces that have non alpha chracters, with others that don't.
If I had a new variant that used regular pieces and a silver general (S! and s!), I would have the same problem, or be forced to use a diferent piece.
The four functions that I have been suggesting would make a vast amount of code already written totally reusable for a wide variety of applications.
OK Fergus.
I'll create a new Alfaerie-Makruk piece set.
Hi Fergus,
This Makruk game with Gary ended in a stalemate draw:
http://play.chessvariants.com/pbm/play.php?game=Makruk+%28Thai+chess%29&log=j_carrillo_vii-penswift-2016-335-570
However, even though the rules for the preset correctly identified the stalemate, and correctly called that this position is a draw; the game hasn't completely "finished" and the clocks are still running.
Can you please help me identified what is wrong?
Thanks Fergus.
I never run into this problem before (with the $status) and a stalemate. (I guess none of my games ever ran into a stalemate before).
Is there something I need to do to the other presets I have programmed for this particular condition?
Or your fix will take care of it for the rules in the other presets?
Is anyone else having problems making moves in Game Courier?
I get a blank screen in both my iPhone and my laptop when I try to make a move in any of my games.
Fergus,
I'm trying to issue a personal invite in Game Courier for Makruk to ramalan, but it keeps being issued as a public invite.
There seems to be a bug with the invite routine.
Jose
Fergus,
I just issued two personal invitations to ramalan, and they went public.
It's still not working.
Hi Fergus. My game below timed out, but it still shows as an active game.Can you please change the status of the game to completed? Thanks.
http://play.chessvariants.com/pbm/play.php?game=Modern+Shatranj&log=j_carrillo_vii-louisxii-2017-127-802
But Fergus, it's not my turn in that game.
The game timed out and should be finished.
It is still showing as an active game and this is incorrect.
http://play.chessvariants.com/pbm/play.php?game=Modern+Shatranj&log=j_carrillo_vii-louisxii-2017-127-802
Thanks louisxii for your kind comments, and the rating!
I also picure the competing hoplites rolling onto each other, everytime I play!
Cheers!
Thanks Fergus.
Here is another one of my games that ended in checkmate, but the status of the game was never change to "finished":
http://play.chessvariants.com/pbm/play.php?game=Fischer+Random+Chess&log=j_carrillo_vii-josesanfer-2004-151-422
Can you please change the status to a win for white? Thanks in advance.
Fergus,
You set the checkmated player as the winner.
White won, not black.
http://play.chessvariants.com/pbm/play.php?game=Fischer+Random+Chess&log=j_carrillo_vii-josesanfer-2004-151-422
Please correct and thank you!
Thanks Erik for the very interesting question. I do understand the question.
Rule 1c states that "it's illegal for a player to immobilize his own Dux".
Since the move you speak of opens a new path for the Dux to move, the Dux would not be immobilized, and therefore it would be a legal move; just like the Go rule where capture has priority over suicide that you refer to.
Thanks for the question. I will update the rules with a few illustration diagrams to clarify this specific situation.
Fergus,
When I search all the Latrunculi XXI games played in Game Courier with this lynk:
http://play.chessvariants.com/pbm/logs.php?game=Latrunculi+XXI&age=0&stat=any
it shows that for game: erik-cvgameroom-2017-340-466 that erik won, which is incorrect.
If you go to the game itself, it shows that Black (me!) won the game. (erik was playing white).
A difference between this game and many other Latrunculi XXI games is that this game was finished with the "won" command, instead of the "resign" command.
Maybe you need to tweak the "won" command so that it shows the correct winner in the Game Logs page.
Thanks Nick.
I never noticed before.
Fergus, there is definitely something wrong with the "won" command and how it assigns the winner in the finished games log.
Here is another example:
http://play.chessvariants.com/pbm/play.php?game=Latrunculi+XXI&log=j_carrillo_vii-wolff-2016-339-951
I won the game as Black, but in the finished games log it shows Nick (White) as the winner.
Interesting, I'm not the only one with this problem.
Did your game finished with the "won" command (instead of the resign command)?
>>Kevin Pacey wrote on 2017-01-25 EST
>> My own suggestion would be that for the diagrammed example, for Modern Shatranj, let the stalemate=win rule
>> override the bare king consideration - the 'logic' being that the stalemated king will perish if the stalemated side
>> attempts to move, whereas the bare king has freedom still.
>> In any case, I don't know how Jose's rules enforcing preset for Modern Shatranj currently would handle the
>> diagrammed example, after the final move is made. [edit: the preset's rules say a lone bare king is an Automatic
>> Loss (if the other side's king isn't immediately bared), so I think I ought to take that at face value, even for the
>> example situation I gave.]
Forgive me for my late response... Better late than never! At least I'm still responding in the same year as the question! :-)
As currently programmed, for the given (unlikely) position, the result of my preset would be a win for the bare King.
I need to check the logic to account for this strange position.
I agree with Joe, it should be an automatic win for Player B, as Player A was bared prior to the stalemate, and the rules only allow for the disadvantaged bared King to play, if he would bare the other king in the next move. Nothing is provided for the case where the bare King could stalemate the opponent on his next move.
I guess this position must have had a lot to do with both stalemate and bare kings (by insuficient material) being draws in modern Chess, to avoid this dilema.
I fixed the preset. Now it will correctly give preference to a win by Bare King over Stalemate, and will correctly give the win to Player B in the position that Kevin had sugested below.
The additional move for the lone King will still be required for this preset, but the Bare King rule precedence over Stalemate will assign the win to the correct player.
I would expect the White player in the center position to resign, rather than to play, but if he plays the preset logic will now award the win to Black (no matter what White plays), and formally end the game.
Fergus,
Here is another game with a problem:
http://play.chessvariants.com/pbm/play.php?game=Latrunculi+XXI&log=j_carrillo_vii-cvgameroom-2017-345-008
I was White, and I won the game. (I used the "won" command to end the game).
Somehow the colors were switched between the players, and I ended up being Black and losing the game.
Please correct it. Thanks.
25 comments displayed
Permalink to the exact comments currently displayed.
I will try to decipher your recomendation later.
Is there any chance that you can add 4 new functions (onlyupper2, onlylower2, isupper2 and islower2) that work identical to their current counterparts, but that only tests the 1st character?
This way the current code for any of the presets can be very easily updated to use new piece-sets, without any major modifications.
Thanks.