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 Earlier
Chess. Play Chess online with other people, using Game Courier, a PBM system that works with any web browser on any computer.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Fri, Feb 7, 2020 06:24 PM UTC:

The presets on this page now use newly designed fairychess code instead of Chess3, though existing games will not be affected by this. The fairychess include file is designed to be easily adapted for other games. Unlike Chess3, it identifies pieces by name instead of label, and it uses constants to associate labels with piece names. It also contains many more piece definitions, and I'll add more as need for them comes up. Just assign piece names to piece labels using constants. If you want to change the name of a piece, you can copy its functions (and subroutine if need be) to another name, then assign your constants to the new name. Here's an example of what could be done in Chinese Chess:

copyfn Chinese_Elephant Elephant;
copyfn Chinese_Elephant-Range Elephant-Range;
copyfn Chinese_Elephant Minister;
copyfn Chinese_Elephant-Range Minister-Range;
setconst e Elephant;
setconst E Minister;

Note that copying functions should be done after the file has been included, since it contains the functions to be copied. I'm not sure what to do about copying subroutines except to copy the whole code and change its name, but few pieces use subroutines.


Kevin Pacey wrote on Tue, Sep 17, 2019 06:20 AM UTC:

Not sure this is the right place for my comment, as it may apply much more to Game Courier than Chess. Anyway, I was trying to use the Record feature for the chess preset. I entered 1.e2-e4 1.e7-e5 2.f1-c4 b8-c6 3.d1-f3 c6-d4 4.f3-f7 successfully (a version of Scholar's mate trap). However, when I tried to do the same thing but also insert "| 3.g8-f6 //is a better move." after Black's 3rd move, I got an error message saying I cannot move my opponent's piece, after I clicked on the 'View' button (that is, I unsuccessfully tried to enter a variation plus comment after the 3rd Black move of the main continuation).

I'm wondering if Game Courier's Record feature isn't fully working properly. In any event, I've yet to see a single webpage on CVP where a recorded game(s) have been offered by the author, and maybe that's no coincidence. [edit: I had missed the example game using the Record feature on the Voidrider CVP webpage. The moves were given, although no variations were offered (just Comments here and there), but more importantly, perhaps, I couldn't view a board from the Voidrider page for the example game.]


🕸📝Fergus Duniho wrote on Sat, Nov 21, 2015 02:33 PM UTC:
I changed #wpr and #bpr to var wpr and var bpr, because these values might be changed by a preset that uses the chess include file. As a general rule, you should use the var operator to get the value of a variable in an expression, because using # plugs the current value directly into the expression, but a function may be used multiple times when a variable has different values.

🕸📝Fergus Duniho wrote on Sat, Nov 21, 2015 12:41 PM UTC:

I seem to have gotten it to work now. I changed

def P 
remove #ep
checkleap #0 #1 1 1
and == var ep join filename #1 rankname #0
or and checkatwostep #0 #1 0 1 0 1 == rankname #0 #wpr 
or checkleap #0 #1 0 1 
and empty #1 
or and islower space #1 checkleap #0 #1 1 1
and > rank #1 rank #0;

to this

def P 
remove var ep
and checkleap #0 #1 1 1
and == var ep join filename #1 rankname #0
or and checkatwostep #0 #1 0 1 0 1 == rankname #0 #wpr 
or checkleap #0 #1 0 1 
and empty #1 
or and islower space #1 checkleap #0 #1 1 1
and > rank #1 rank #0;

Remember that Game Courier reads all of this backwards, and this is just one of two Pawn functions. The first change I made was to the logic of the function. I put an and in front of the second to last operation, checkleap #0 #1 1 1, so that nothing would be left on the stack when it got to the last operation. Since it still didn't work, I changed #ep to var ep. That worked. Now, why would I need var ep but get away with using #wpr. The difference is that wpr is effectively a constant, keeping the same value throughout execution of the program. So, when I define the function, wpr already has the value I will need it to have whenever I use the function. But ep is a true variable whose value keeps changing. To make sure the function uses its current value, I need to use var ep instead of #ep.

The remove built-in function is a new one for removing a piece from a space. It exits automatically with the value of an assignment to '@'. Most built-in functions do not change anything, focusing instead on returning values. But I wanted to check possible Pawn moves with a function alone instead of using a subroutine.


🕸📝Fergus Duniho wrote on Sat, Nov 21, 2015 03:43 AM UTC:


🕸📝Fergus Duniho wrote on Fri, Nov 20, 2015 07:26 PM UTC:
The chess include file is now storing legal moves. To do this, it has had to become less optimized than it used to be. It is now more like the chess2 include, the main difference being that is still uses a specialized function instead of a generalized subroutine to check whether the King is in check. This is more efficient but needs to be changed for games with additional pieces. The functions in the include file cover all pieces in Chess plus the Marshall (K+R) and Archbishop (K+B).

While this is working for Chess, I may have to continue working on it later to get it to work right with other games that do castling differently. For the time being, I will leave in old functions and subroutines that might be used in presets or include files that include this one.

🕸📝Fergus Duniho wrote on Fri, Nov 20, 2015 03:53 PM UTC:
I'm currently working on updating the chess include file to store legal moves for onclick display, but until I get it working, Chess and many other games using this include file may not work properly.

🕸📝Fergus Duniho wrote on Wed, Nov 18, 2015 07:45 PM UTC:
The Chess2 include file is now updated to use a stalemated subroutine that records all legal moves, which allows Game Courier to display the legal moves for a piece when a player clicks to move it. This does not affect the main Chess preset, but it does affect other presets that use the Chess2 include file, such as Hexagonal Chess and Caissa Britannia.

🕸📝Fergus Duniho wrote on Fri, Apr 27, 2012 05:30 PM UTC:
I have just added support for the 50 moves rule in Chess. Here is how it was done. I created a counter called nopvc, which means no Pawn or capture, and set it to zero. Whenever a Pawn moved or a piece was captured, it got reset to zero. Otherwise, it got incremented by 1. In the post-game part, I compared its value with 50. This is done after checkmate and stalemate are checked for just in case the 50th move resulted in a checkmate.

Also, I realized I was using a global variable for posvar in the code for enforcing three-times repetition. So I removed the code in the post-game part for computing the value of posvar. The value it needs to be has already been set the last time posvar was given a value.

🕸📝Fergus Duniho wrote on Fri, Apr 27, 2012 04:31 PM UTC:

I have just added support for the three-times repetition rule in Chess. When a player creates the same board position for the third time, and all the same moves are available, as in castling and en passant conditions are the same, then the game ends in a draw.

Here is how it is done. At the end of each post-move section, a variable representing the current state of the game is incremented, using code like this:

set posvar join "w" join fencode boardflags;
inc #posvar;

In the post-game section, the variable name for the current state of the board is computed, and its value is compared with 3, using code like this:

set posvar join "w" join fencode boardflags;
if >= var #posvar 3:
  say Three Times Repetition! Drawn Game!;
  drawn;
endif;

The code I've shown is for White. For Black, substitute "b" for "w".

I wrote the boardflags operator today. It returns an ordered string of all the flags that are turned on and whose names match coordinate positions. The variable posvar gets set to a long string that will be used as a variable name. #posvar returns the value of posvar, and var #posvar returns the value of the variable whose name is stored in the variable posvar.


M Winther wrote on Mon, Dec 27, 2010 08:08 AM UTC:
I've already had good use of the 'continuemove' command in my
Twinmove Chess (compulsory) and Twinmove Chess (uncompelled)
These are two attractive presets now, much easier to handle. And
these double-move variants are really interesting.
/Mats

🕸📝Fergus Duniho wrote on Sun, Dec 26, 2010 07:31 PM UTC:
I guess I lost the original versions of continuemove and redomove by overwriting a newer file with an earlier file. So I rewrote them, doing it differently this time, because I didn't remember exactly what I did before. But the functionality should be the same. Continuemove is another name for extendmove. Redomove is just like continuemove except that it does not retain any past moves. They use the same code, differing only in what they set the pastmovesfield string to. I am using the names continuemove and redomove to reflect their similarity to the continue and redo commands used for loop control. Like these commands, they are used for a kind of loop control, except that instead of the loop existing inside a single program, the loop is between moves executed by different programs. Like continue and redo, unconditional or improper use of continuemove and redomove can create infinite loops.

🕸📝Fergus Duniho wrote on Sat, Dec 25, 2010 02:19 AM UTC:
It appears I lost some changes I recently made, and I'm going to have to redo them.

M Winther wrote on Fri, Dec 24, 2010 12:44 PM UTC:
Fergus, what are these commands 'continuemove' and 'redomove' in the Developer's Guide? They don't seem to be implemented yet(?) 
/Mats

M Winther wrote on Tue, Dec 21, 2010 06:45 AM UTC:
Yes, that was how my plycount worked, and it obviously works now. Thanks.
/Mats

🕸📝Fergus Duniho wrote on Tue, Dec 21, 2010 04:15 AM UTC:

Okay, I programmed Chess - Test to count plyturns, and after making a few changes to how constants work, I got it to work. You can try it before I change the code to something else. Let me know if it works the same as yours.


M Winther wrote on Tue, Dec 21, 2010 03:51 AM UTC:
No, I don't use constants in this preset anymore, and Fischer Placement Chess
isn't randomized. It is a manual method of generating 25 Chess960 positions.
However, I again inserted the old code, which uses a constant. And it has
ceased working. I then changed this constant to a variable, and it works
again.

I suggest that you revert to the old way of how constants function. There
might be many presets that have stopped working now.

The way in which I used the constant is this: I first, in the precode, make
setconst plyturn 1;, then I call unsetconst plyturn; setconst plyturn 2;,
etc., and increment plyturn in order to keep count of which turn it is.
This simple method doesn't work anymore. (I just happened to use it
because you recommended constants in the problems with the ask command.)
/Mats

🕸📝Fergus Duniho wrote on Tue, Dec 21, 2010 12:38 AM UTC:
I can't find your Fischer Placement Chess, but if it is letting players place their pieces as they wish instead of randomly placing pieces, then it doesn't need constants to store the initial positions. The games of Fischer Random Chess I've checked are all working fine, and the tests I've run to check whether constants are working have worked fine.

🕸📝Fergus Duniho wrote on Mon, Dec 20, 2010 06:37 PM UTC:
I originally created constants because the algorithm for picking random numbers changed, which broke all games of Fischer Random Chess and other random variants. I used to rely on reusing the same seed value, which worked fine as long as the algorithm for picking random numbers didn't change. If it doesn't change again, constants are unnecessary for these games. But if it ever does change again, the constants will preserve games started before the change.

M Winther wrote on Mon, Dec 20, 2010 05:14 PM UTC:
Good, however I can make do without constants. My Fischer Placement Chess works excellently now, with automatic pawn promotion, castling, et al.
/Mats

🕸📝Fergus Duniho wrote on Mon, Dec 20, 2010 05:11 PM UTC:
I'll look into it.

M Winther wrote on Mon, Dec 20, 2010 06:43 AM UTC:
Fergus, are you certain that you haven't compromised the function of certain presets now that you have changed how constants function? Today I discovered that my Fischer Placement Chess preset has stopped working. I make use of a constant in it (however, I can change that to a variable). 
/Mats

M Winther wrote on Mon, Dec 20, 2010 06:12 AM UTC:
Thanks, but you really must explain this better in the documentation about ask and askpromote, otherwise it will be an eternal source of frustration. 
/Mats

🕸📝Fergus Duniho wrote on Mon, Dec 20, 2010 03:51 AM UTC:

It looks like I now have constants working in solitaire mode. Still, it can be more effective to test whether ask is required by checking whether the move entered by the player is incomplete. This keeps it from unnecessarily calling ask when it isn't needed. And once the move is completed, it wouldn't have to call ask again.


🕸📝Fergus Duniho wrote on Sun, Dec 19, 2010 06:17 PM UTC:

Now that I think about it, constants will not work in solitaire mode, because it never writes anything to a log. I am going to work on including constants in the forms that pass variable values. In the meantime, you might write your code to check the contents of the move, which you can check with the thismove keyword in an expression. Since the ask command will append to the move, all you have to check is whether the move is complete. For example, if your short and long castling moves differ on the position the Rook moves to, check the move for a Rook move, calling on ask only if the Rook move isn't present. Doing it this way also stops ask from being used when a player manually enters in the full move.


M Winther wrote on Sun, Dec 19, 2010 08:48 AM UTC:
Fergus, I am having problems with the *ask* command. It seems to end up in an eternal loop. When I choose an alternative it merely asks again. I even use a constant to prevent eternal loops, but it doesn't help. (In the following code I use 'skip' for testing purposes):

[...]
elseif equal moved K;
    set legal or checkleap origin dest 1 1 checkleap origin dest 1 0;
    if var legal; 
      if and equal dest c1 equal #wcastletest 0;
        unsetconst wcastletest; 
        setconst wcastletest 1;
	if or and equal origin b1 and equal @ space d1 equal R space a1
              and equal origin d1 and equal @ space b1 equal R space a1;
	   ask 'Do you want to castle long?' 'y' 'skip' 'n' 'skip';
        endif; 	
      endif;
    else;
[...]
    endif;
endif;


Nor can I get 'askpromote' to work. This generates an eternal loop:

if and var legal equal rankname dest 8;
      askpromote Q R B N;
endif;

/Mats

M Winther wrote on Sat, Dec 18, 2010 06:39 AM UTC:
Thanks for the clarification.
/Mats

🕸📝Fergus Duniho wrote on Fri, Dec 17, 2010 10:52 PM UTC:
Since you are using an if-elseif statement, the elseif code will not get executed when the if code has been executed. If you change your elseif to an if (and close off the previous if with an endif), you can see that it does immediately recognize the change in the variable's value. As your code exists, it is still going to create an infinite loop. Note that this is actually an infinite meta-loop, not a loop inside the program. For each move, Game Courier constructs and runs a GAME Code program from the beginning. Each time it runs this program, the flag firstturn gets turned on, causing your 'if flag firstturn' code to run. Since extendmove appears in this code block, it constructs and runs a new GAME Code program before bringing you to the Verify form. It then executes extendmove again, and again and again for each new move you make, adding all the moves into one long move statement for White's first move. If you replace your firstturn flag with a firstturn constant whose value you change once by deleting it and creating it again with a new value, this should break you out of the infinite loop. Unlike a variable, a constant exists in the log, and you can change what its value will be at the beginning of the program used for subsequent moves. What I have done instead of this in my old Korean Chess preset is to use extendmove only when certain moves are made, which I then translate into other moves that do not call on the use of extendmove.

M Winther wrote on Fri, Dec 17, 2010 08:14 AM UTC:
Of course, 'extendmove' must be conditioned, but it seems like the flags don't change their value when 'extendmove' is used(?). Correct me if I'm wrong; if I change a flag in order to make extendmove conditional, the flag doesn't actually change its value until the other *colour* gets the turn. 

Example: 

if flag firstturn;

  if == origin e1 and == dest g1:
    setsystem moves 'swap e1 g1';
    add K g1 N e1;
  endif;

  unsetflag firstturn; 
  setflag secondturn; 
  extendmove;

elseif flag secondturn;

  if equal moved Q;
    setsystem moves 'swap origin dest';
    add moved origin moved dest;
  endif;

  unsetflag secondturn; 

endif;

In the above code 'secondturn' is executed by the same colour. But this code is never executed because the flag 'secondturn' does not actually change its value until the other player gets the turn. The command extendmove seems to have this effect, if I'm correct.

/Mats

M Winther wrote on Fri, Dec 17, 2010 06:33 AM UTC:
Good. How about the problem that the board does *not* turn (in single mode) when first player is set to Black?
/Mats

🕸📝Fergus Duniho wrote on Fri, Dec 17, 2010 05:44 AM UTC:
I now seem to have extendmove working well in both solitaire and correspondence modes. Just remember that extendmove will create an infinite loop when used unconditionally. It is analogous to the continue command.

🕸📝Fergus Duniho wrote on Fri, Dec 17, 2010 12:00 AM UTC:

Okay, the problem on my end is that the extendmove command is not yet working properly in solitaire mode. But my tests indicate that it is working properly in correspondence mode.

The problem on your end is that putting extendmove as the final command in the postmove code creates an infinite loop. It's not a proper use of the command. It should only be used within a conditional statement that checks whether it needs to be called. In this Chess game between myself and my alter ego, extendmove is the only command, occurring in post-move1 by itself. It does not turn the board around, but it creates an infinite loop in which White can keep moving one piece after another but is never able to send the move to his opponent. You can try it yourself.


M Winther wrote on Thu, Dec 16, 2010 08:04 AM UTC:
Fergus, if I insert it *last* in the post-move code, as the final command (or as the only command), then the move is extended, but the board turns. You can test it yourself, it takes 15 seconds.
/Mats

🕸📝Fergus Duniho wrote on Thu, Dec 16, 2010 05:13 AM UTC:
Where precisely are you inserting it?

M Winther wrote on Thu, Dec 16, 2010 04:53 AM UTC:
But I'm not doing anything. I just insert the statement 'extendmove' and the board still turns. So there is nothing to look at. It works, because I can move the same colour again, but from the top of the board. This is confusing, of course.
/Mats

🕸📝Fergus Duniho wrote on Tue, Dec 14, 2010 05:41 PM UTC:
Mats, In case you don't know the difference between show and tell, you haven't shown me anything yet. If I'm to help you, I need to actually see what you're doing, not just be told what you're doing.

🕸📝Fergus Duniho wrote on Tue, Dec 14, 2010 05:38 PM UTC:
Because one move does the job, and I'm now using the new rewritemove command with it, because the repositioning should be done before either player moves.

M Winther wrote on Tue, Dec 14, 2010 04:44 PM UTC:
Fergus, why don't you try to implement your Janggi with two relocation moves in a row, and make use of extendmove. 
/Mats

🕸📝Fergus Duniho wrote on Tue, Dec 14, 2010 12:27 AM UTC:

I need you to show me the preset you are using the extendmove command in.


M Winther wrote on Mon, Dec 13, 2010 06:33 PM UTC:
When I use extendmove I hoped to be able to make one more move with the same player. This seems to work, however, the board has turned. If white is going to make one more move, he has to do it with his pieces at the top of the board, and this is awkward.
/Mats

🕸📝Fergus Duniho wrote on Mon, Dec 13, 2010 04:16 PM UTC:
You'll need to show me what you're actually doing with the command.

M Winther wrote on Mon, Dec 13, 2010 06:40 AM UTC:
However, I have a problem. If the game is started with Black as the first party to move, then the board doesn't turn when a move is made. It's a bug in Game Courier. (This is regardless of extendmove.)

Moreover, after 'extendmove' the board is still turned, which forfeits the purpose of the command, I think.
/Mats

M Winther wrote on Sun, Dec 12, 2010 02:50 PM UTC:
Wonderful! Thanx! I think I can attract more chessplayers to the site to test my Relocation variants, when I have implemented them, because this is chess close to Fide chess. What was the latest Anand vs. Carlsen game all about? I say computer preparation far into the middle game. I don't believe in this development.
/Mats

🕸📝Fergus Duniho wrote on Sun, Dec 12, 2010 04:01 AM UTC:

The extendmove command should do what you want. It does not change the turn order, and it does not force anyone to pass a turn. What it does is return the player to the form for making a move, showing the moves as they have already been made for that turn, and allowing the player to make another move. It then appends the new move to the past moves. It may be used once or multiple times for longer moves, depending on what is called for. When using this command, care should be taken that it only be used for the current move. This may involve writing code that distinguishes between partial moves and complete moves. Basically, it lets you use the mouse to do what you could always do previously by typing moves manually. See my current code for Korean Chess for an example similar to what you want. It allows the player to swap one or both pairs of Knight and Elephant, then immediately make a move, all using the mouse. But I'm going to change this in a new preset, because this doesn't follow the rules of Korean Chess strictly.


M Winther wrote on Sun, Nov 28, 2010 07:15 AM UTC:
Good. Now you only need to implement a way of disrupting the move order,
e.g. give a command, for instance, 'keepturn' and the turn remains with
the player who just moved. In this way I can implement my revolutionary
Relocation Variants. Perhaps this could be implemented by forcing a pass move(?).
/Mats

🕸📝Fergus Duniho wrote on Sun, Nov 28, 2010 03:44 AM UTC:
I have added a new command to the Pawn subroutines in the chess.txt and chess2.txt include files. This new command, called askpromote, will ask you what you want to promote a Pawn to when you advance a Pawn to the last rank without promoting it first. This is useful with point-and-click movement, in which you get to make only the first part of your move before the move gets entered into Game Courier. This will affect other presets that use these subroutines. I have made use of the wprom and bprom variables, which are arrays of all the pieces each Pawn may promote to, based on the assumption that a Pawn may promote to any piece of its own color originally on the board besides a King and a Pawn. Since names aren't programmed into the presets, it uses piece images to identify the pieces.

linhaoying wrote on Thu, Nov 18, 2010 12:10 PM UTC:Average ★★★
not fun

🕸📝Fergus Duniho wrote on Sun, Jan 4, 2009 08:23 PM UTC:
For interested developers, I have added a link to a Chess preset that uses the chess2 include file.

kween wrote on Wed, Sep 20, 2006 06:54 AM UTC:Good ★★★★
the games no fun if you cheat

shivangi wrote on Mon, Apr 24, 2006 07:30 AM UTC:Excellent ★★★★★
Good Site seems to be Intresting

Aarti wrote on Wed, Dec 28, 2005 01:57 PM UTC:Good ★★★★
I tried playing the chess as instructed. It is very good experience. I could not find any bug in it. Well done. Aarti from http://www.orchidsnroses.com

🕸📝Fergus Duniho wrote on Tue, Mar 9, 2004 04:15 AM UTC:
I did some more debugging this evening. I fixed a bug, reported by Antoine,
that allowed a piece to capture another piece of its own color. I also
fixed a bug in my Polish notation calculator that caused it to ignore
checks from Knights. I spent the past hour or so entering moves from a
game between Captain Smith and Philidor. The entire game played through,
and I caught the Knight bug while trying to make illegal moves on
occasion. At the end, I tested the checkmated King's moves, and none were
allowed. One was because it couldn't capture a piece on the same side,
and the rest were because it couldn't move into check. I also tried
moving another piece, but the King remained in check, so the move wasn't
allowed.

The one remaining bug that I know of has to do with being able to enter
illegal moves by entering multiple moves with semicolons or by entering
commands. This has to do with what kind of entry data is allowed and not
with the preset per se. If I included an option for restricting entry
data, I could stop the entry of illegal moves. But for now at least, I am
going to consider this bug acceptible. The preset is good enough to keep
you from making illegal moves by mistake. It just won't prevent you from
deliberately making some kinds of illegal moves. But on those occasions
when you did deliberately make an illegal move, it would be obvious to
your opponent that your move wasn't well-formed.

Other than that, it seems to be in full working order. Try it out and let
me know if you find anything amiss.

52 comments displayed

Later Reverse Order Earlier

Permalink to the exact comments currently displayed.