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 Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sun, Jan 2, 2005 04:47 PM EST:
This comment, which I accidently posted on the wrong page a couple days
ago, belongs on this page:

I added the following new functions to the Polish notation calculator
today:

checkmaxsteps
checknsteps
checkpath

These all handle movement that may go along a winding, unobstructed path,
such as the movement of some pieces in Jetan. The checkmaxsteps function
checks whether a piece may move from one space to another within a
specified number of steps from one adjacent space to another. The
checknsteps function checks whether a piece may move from one space to
another in exactly a specified number of steps. Both of these functions
allow movement through the origin space and repeated movement through the
same space. They are both handled by a recursive function that goes
through all possible paths until it finds one that works. The checkpath
function checks whether a piece can move from one space to another by
following a specific path, given as a set of paired directions. To
illustrate how these work, here are two alternate ways to handle the
Squire from Holywar:

Barring possible mistakes, here is the long way that uses 16 checkpath
functions for all possible paths:

checkpath origin dest (1 0 1 1) or checkpath origin dest (1 1 1 0) or
checkpath origin dest (1 0 1 -1) or checkpath origin dest (1 -1 1 0) or
checkpath origin dest (-1 0 -1 1) or checkpath origin dest (-1 1 -1 0) or
checkpath origin dest (-1 0 -1 -1) or checkpath origin dest (-1 -1 -1 0)
or
checkpath origin dest (0 1 1 1) or checkpath origin dest (1 1 0 -1) or
checkpath origin dest (0 1 -1 1) or checkpath origin dest (-1 1 0 -1) or
checkpath origin dest (0 -1 1 1) or checkpath origin dest (1 1 0 1) or
checkpath origin dest (0 -1 1 -1) or checkpath origin dest (1 -1 0 1);

Here is the short way that uses checknsteps in combination with
checkleap:

checkleap origin dest 1 2 and checknsteps origin dest 2;

The checkleap function makes sure that the piece is going to a space a
Squire could move to, then the checknsteps function makes sure it can get
there in exactly two steps.