Check out Atomic Chess, our featured variant for November, 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 ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order Later
The birth of 3 new variants - part 1 : Grand Apothecary Chess Alert[Subject Thread] [Add Response]
Aurelian Florea wrote on Mon, May 31, 2021 05:11 PM UTC:

Thanks!


Aurelian Florea wrote on Wed, Jun 2, 2021 07:17 AM UTC:

Fergus, is there a way to customize the blue color that highlights possible moves?


Aurelian Florea wrote on Wed, Jun 2, 2021 07:33 AM UTC:

Fergus, Is it not that in the fairy chess include file the functions :

def White_Pawn-Range array where #0 0 2 where #0 0 1 where #0 -1 1 where #0 1 1; def Black_Pawn-Range array where #0 0 -2 where #0 0 -1 where #0 -1 -1 where #0 1 -1;

for generality they should be:

def White_Pawn-Range array where #0 0 var fps where #0 0 1 where #0 -1 1 where #0 1 1; def Black_Pawn-Range array where #0 0 - var fps where #0 0 -1 where #0 -1 -1 where #0 1 -1;

?


🕸Fergus Duniho wrote on Wed, Jun 2, 2021 09:10 PM UTC in reply to Aurelian Florea from 07:33 AM:

You were correct in identifying the problem. The range functions for the Pawns did not take into account the value of fps. However, replacing 2 with fps would not allow for first Pawn moves that are shorter than the maximum possible distance. For example, if fps were set to 3, this would include 3-space moves, but it would not include 2-space moves. This is what I ended up with:

def White_Pawn-Range mergeall where #ori -1 1 where #ori 1 1 filter lambda (onboard #1) aggregate lambda (where #ori 0 #0) range 1 var fps =ori;
def Black_Pawn-Range mergeall where #ori -1 -1 where #ori 1 -1 filter lambda (onboard #1) aggregate lambda (where #ori 0 neg #0) range 1 var fps =ori;

These use aggregate to create an array of spaces a Pawn may advance forward to, and they use filter to weed out non-spaces that are out-of-range. They use a named parameter in order to use its value in the lambda function used by aggregate.

I have since modified the functions above to use the filter on all results:

def White_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 1 where #ori 1 1 aggregate lambda (where #ori 0 #0) range 1 var fps =ori;
def Black_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 -1 where #ori 1 -1 aggregate lambda (where #ori 0 neg #0) range 1 var fps =ori;

Finally, I replaced aggregate with an expanded version of the values operator. With a lambda function and an array, it will work just like filter except that it returns a sequential array of each value calculated by the lambda function. Unlike aggregate, it will include values of zero, because it does no filtering on the results it calculates. As it did before, it will return the values of an array if that is what's passed to it. If it does not get a lambda function or an array, it will return the rest of the arguments following it as a single array.

def White_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 1 where #ori 1 1 every lambda (where #ori 0 #1) range 1 var fps =ori;
def Black_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 -1 where #ori 1 -1 every lambda (where #ori 0 neg #1) range 1 var fps =ori;

Aurelian Florea wrote on Thu, Jun 3, 2021 04:29 AM UTC:

Fergus, What about the ability of changing the blue color of the highlighting when showing possible moves.


Aurelian Florea wrote on Thu, Jun 3, 2021 11:32 AM UTC:

@Fergus, I think the berolina pawns have the same problem that the regular pawns had!


Aurelian Florea wrote on Fri, Jun 4, 2021 01:33 PM UTC:

@Fergus, A third thing if I may ask in these game the king may castle in 2 ways with the rook that starts near the corner of the board or with the corner cannon. Omega chess implements a castle move with a non corner piece. Can I combine this with the regular castling subroutine in order to easily make my castle subroutine work?


Aurelian Florea wrote on Wed, Jun 16, 2021 11:44 AM UTC:

@Fergus, Hello,

I had asked 3 questions on this thread 2 weeks ago. It seems that you have missed them. Can you find time to take a look?


🕸Fergus Duniho wrote on Wed, Jun 16, 2021 03:14 PM UTC in reply to Aurelian Florea from Thu Jun 3 04:29 AM:

Fergus, What about the ability of changing the blue color of the highlighting when showing possible moves.

It uses the border color to highlight possible moves.


Aurelian Florea wrote on Wed, Jun 16, 2021 04:30 PM UTC in reply to Fergus Duniho from 03:14 PM:

I can't figure it why but I have a green background and a blue highlight. Look here, please:

https://www.chessvariants.com/play/pbm/play.php?game=Grand+Apothecary+Chess+1&settings=Default


🕸Fergus Duniho wrote on Wed, Jun 16, 2021 06:47 PM UTC in reply to Aurelian Florea from 04:30 PM:

I can't figure it why but I have a green background and a blue highlight.

At some point, I started using highlight color instead. I included this in the form players could use to customize the appearance of a game, but I neglected to add it to the Edit form used by game designers. I have now added it in.


Aurelian Florea wrote on Wed, Jun 16, 2021 06:54 PM UTC in reply to Fergus Duniho from 06:47 PM:

Thank you!


Aurelian Florea wrote on Sat, Jun 19, 2021 04:00 PM UTC in reply to Fergus Duniho from Wed Jun 16 06:47 PM:

@Fergus,

Could you find the time to also solve for berolina pawns the problem that regular pawns used to have in fairychess.txt


🕸Fergus Duniho wrote on Mon, Jun 21, 2021 10:53 PM UTC in reply to Aurelian Florea from Sat Jun 19 04:00 PM:

Could you find the time to also solve for berolina pawns the problem that regular pawns used to have in fairychess.txt

Okay, I've done that.


🕸Fergus Duniho wrote on Mon, Jun 21, 2021 11:04 PM UTC in reply to Aurelian Florea from Fri Jun 4 01:33 PM:

A third thing if I may ask in these game the king may castle in 2 ways with the rook that starts near the corner of the board or with the corner cannon. Omega chess implements a castle move with a non corner piece. Can I combine this with the regular castling subroutine in order to easily make my castle subroutine work?

What castling rule do you want it to work for?


Aurelian Florea wrote on Tue, Jun 22, 2021 06:05 AM UTC in reply to Fergus Duniho from Mon Jun 21 11:04 PM:

I don't understand your question, Fergus. I think I have explained it above.


🕸Fergus Duniho wrote on Tue, Jun 22, 2021 02:01 PM UTC in reply to Aurelian Florea from Fri Jun 4 01:33 PM:

According to the comments preceding the castle subroutine, you need to flag the spaces of pieces that may legally castle. The subroutine does not care what the pieces are. If you flag both the rook and the cannon, it will, once other conditions pertain, initially allow castling with the rook, but if the rook moves out of the way, it will allow castling with the cannon.


17 comments displayed

EarliestEarlier Reverse Order Later

Permalink to the exact comments currently displayed.