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 by FergusDuniho

LatestLater Reverse Order EarlierEarliest
How to Enforce Rules in Game Courier. A tutorial on programming a rule-enforcing preset in the GAME Code language.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Thu, Jan 19, 2023 07:49 PM UTC in reply to Daniel Zacharias from 07:32 PM:

Is there any reason for the pawn function to include non-capturing moves since the actual movement is handled by the subroutine?

The function has to handle potential moves, since it is used to determine whether a potential move is legal. Back when functions were used only with the checked subroutine, the pawn function would only have to concern itself with capturing moves. Now that the stalemated subroutine systematically makes a list of every legal move for the purpose of displaying legal moves when a player clicks on a piece, it is important for each function to cover every possible move a piece can make. When a piece has only a function and no subroutine, the function has to cover both potential and actual moves. But when a subroutine is used for the actual moves, all the function has to cover are the potential moves.


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 Thu, Jan 19, 2023 07:42 PM UTC in reply to Fergus Duniho from 07:29 PM:

This code is designed to show that a string or expression between braces will be evaluated immediately:

set a Adam;
def a1 {#a};
def a2 #a;
print fn a1;
print fn a2;
set a Abel;
print fn a1;
print fn a2;

Here is the output:

Adam

Adam

Adam

Abel

🕸📝Fergus Duniho wrote on Thu, Jan 19, 2023 07:29 PM UTC:

I repurposed a feature that didn't seem to have any useful purpose. Braces have normally been used to insert the value of variables into strings. When the string between the braces included spaces, these would be converted to periods. I think my intention was to turn space separated strings into multi-dimensional array variables, but in tests, this did not work. So, I replaced the implode function used to turn the array of words into a single string with a period between each word with the function used to evaluated a GAME Code expression. The result is that a GAME Code expression can now be placed between braces in any command, and the result of that expression can be used as an argument to a command or inserted into a string. Note that expressions between braces will be evaluated immediately when the line is executed. So, they should not be used in function definitions unless the intent is to programmatically create a function. In my preliminary tests, I haven't noticed this causing any problems. I will do more tests later.


How to Enforce Rules in Game Courier. A tutorial on programming a rule-enforcing preset in the GAME Code language.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Thu, Jan 19, 2023 04:18 PM UTC in reply to H. G. Muller from 11:50 AM:

If this is 'Post-Move' code, the Pawn has already landed on the to-square, so that it is no longer empty?

Correct.

verify == captured @;

verify not capture; should also work.

For my understanding: why is it necessary to copy the screen to a variable, before testing it. Is there a problem with writing

capture screen;

When I started what became the GAME Code language, I started with commands, which simply took arguments, and I let arguments be separated by spaces. I added expressions to the language later, and I used Polish notation, which also used spaces as separators, because it was easier to implement than infix syntax with parentheses, and its prefix syntax would be quicker to interpret too, which matters for an interpreted language written in another interpreted language. Because of these choices, it's not easy to distinguish between an expression and a list of arguments. So, instead of letting an expression be used anyplace an argument can be used, only some commands can interpret expressions. These include commands for setting variables or for controlling the flow of the program.


🕸📝Fergus Duniho wrote on Thu, Jan 19, 2023 02:47 AM UTC in reply to Daniel Zacharias from 02:17 AM:

The line capture screen will not work, because the capture command cannot evaluate an expression. Save the value of screen to a variable, then use the variable with the capture command.

Also, the value of screen is set after calling checkahop, but you are calling screen before checkahop. Remember that expressions are evaluated from end to front, which is the reverse of reverse polish notation, or just polish notation. So, your code should look like this:

verify checkahop #from #to -1 1 or checkahop #from #to 0 1;
verify islower screen;
set scrn screen;
capture #scrn;

Glinski's Hexagonal Chess. Chess on a board made out of hexagons. (Recognized!)[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Wed, Jan 18, 2023 07:48 PM UTC in reply to Fergus Duniho from 07:33 PM:

That's now fixed too. When displaying the board from Black's perspective, the CSS uses right and top instead of left and bottom, but I had pasted some code using left and bottom.


🕸📝Fergus Duniho wrote on Wed, Jan 18, 2023 07:33 PM UTC in reply to Daniel Zacharias from 05:33 PM:

It's now displaying correctly, though it isn't switching the display properly when it is Black's turn.


🕸📝Fergus Duniho wrote on Wed, Jan 18, 2023 05:53 PM UTC in reply to Daniel Zacharias from 05:33 PM:

It will display properly if you change the rendering method to GIF, JPG, or PNG. I'll look into why the CSS method is not getting the same results.


4D Hexagonal Chess. 4D analogue of Glinski's Hexagonal Chess based on Hyperchess4. (5x(5x(5x5)), Cells: 361) [All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Jan 17, 2023 08:38 PM UTC in reply to Kevin Pacey from 05:43 PM:

The diagram for the rules page alone still has the pieces too big, it seems.

The script is fixed, but the image is cached. If you modify the URL in some way, such as rearranging arguments in the query string, this will stop it from showing the cached image.


Parity Chess. Chess on a 12x8 board with Champions and FADs added.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Jan 17, 2023 05:42 PM UTC in reply to Kevin Pacey from 01:13 AM:

The same thing happened to me. The reason why is that the preset lists the sides as "Black White" instead of the usual value "White Black". Although his pieces are white, and he is moving first, it says he is playing Black. This is because the name of Black is being used for the first player in the preset. The author of the preset should correct this to avoid confusion.


4D Quasi-Alice Chess. Four dimensional 8x8x2x2 game that's rather like Alice Chess.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Jan 17, 2023 05:26 PM UTC in reply to Kevin Pacey from 02:44 AM:

This is fixed.


52Chess. A piece may teleport to the square corresponding to a drawn card.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Jan 17, 2023 05:25 PM UTC in reply to Kevin Pacey from 02:46 AM:

This is fixed.


4D Hexagonal Chess. 4D analogue of Glinski's Hexagonal Chess based on Hyperchess4. (5x(5x(5x5)), Cells: 361) [All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Jan 17, 2023 05:24 PM UTC in reply to Kevin Pacey from 02:41 AM:

This is now fixed. After changing how drawdiagram.php uses the scale value, I didn't properly account for pieces that were smaller than 50x50. While David had made the Alfaerie pieces all 50x50, I had not done the same for my pieces, which usually came in various sizes that fit within 50x50. So, I added some code for that.

Game Courier has not been designed to use the scale value while drawing the board. It still uses it only after the board has been drawn, but the script that drew the board was not using the scale value on desktops. So, I corrected that.

Curiously, the board looks better on Game Courier than in the Diagram Designer. So, I may have to modify drawdiagram.php to use the scale value after drawing the board and while drawing the pieces.


ChatGPT[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Sun, Jan 15, 2023 09:30 PM UTC in reply to Jean-Louis Cazaux from 07:20 PM:

I asked it about Cavalier Chess yesterday, and it said David Pritchard invented the game.


🕸Fergus Duniho wrote on Sat, Jan 14, 2023 07:57 PM UTC:

Me: Have you ever invented a Chess variant?

ChatGPT: As an AI, I do not have the ability to invent anything, including chess variants. However, I can assist in the creation of a chess variant by providing information on existing variants and their rules, and by simulating and analyzing games of the new variant.

Me: Who created Timekeeper Chess?

ChatGPT: Timekeeper chess is a chess variant created by Dr. Hans Berliner. He was a German-born American International Master of correspondence chess, a former World Correspondence Chess Champion, a computer scientist and professor of computer science at Carnegie Mellon University, and a pioneer in the field of computer chess. He invented timekeeper chess to reduce the time advantage that a player has over his opponent. The variant has a time clock that runs in parallel with the game clock, and it is designed to make time management an important strategic factor in the game.

Me: Does this game have a piece called a Timekeeper?

ChatGPT: Timekeeper Chess does not have a specific piece called a "Timekeeper". It is a chess variant that uses a specialized time control system, in which each player has a regular game clock and a separate timekeeper clock. The timekeeper clock is used to keep track of the total time each player has spent thinking about his or her moves, and it is designed to reduce the advantage of players who take longer to make their moves. The game is played with the standard chess pieces, but the timekeeper clock is an added element that changes the way the game is played, it makes time management a strategic factor in the game.

Me: Do you know Greg Strong?

ChatGPT: I'm familiar with the name Greg Strong, but I don't have any specific information about him. It's a common name, and there might be many people with this name. Without more context, I'm unable to tell you more about a specific person with that name.

Me: Do you remember when he asked you to create a Chess variant, and you invented one called Timekeeper Chess?

ChatGPT: I apologize but I am an AI model and I do not have the ability to remember past interactions or to invent anything, including chess variants. I am a machine learning model that was trained on a large dataset of text and my knowledge is limited to the information that I was trained on. I provided information on Timekeeper chess that was created by Dr. Hans Berliner, a computer scientist and professor of computer science at Carnegie Mellon University, I do not have any information about any other person, such as Greg Strong, asking me to invent a chess variant.

Me: Can you create a Chess variant?

ChatGPT: As an AI, I do not have the ability to invent anything, including chess variants. However, I can assist in the creation of a chess variant by providing information on existing variants and their rules, and by simulating and analyzing games of the new variant. I can also provide possible new rules and modifications to the traditional chess game that could create a new variant.

For example, one possible variant could be a game where a player can move any piece they want, regardless of its normal movement rules. Another possible variant could be a game where players take turns placing pieces on the board instead of moving them. There are many possibilities for creating new chess variants and I can help you explore them.


Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Fri, Jan 13, 2023 11:52 PM UTC:

To prevent the recoloring of pieces not meant to be recolored, such as Shogi pieces, I stopped assigning values to $originalwhite and $originalblack if the set doesn't already have known colors.


Kamikaze Mortal Shogi[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Fri, Jan 13, 2023 09:07 PM UTC in reply to wdtr2 from 07:34 PM:

Thanks for reporting this. This is now fixed. It turns out that Kamikaze Mortal Shogi was running older code than Shogi was.


Shogi. Play the Japanese form of Chess, in which captured pieces can be dropped back as your own. (Recognized!)[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Fri, Jan 13, 2023 02:38 AM UTC in reply to Daniel Zacharias from 01:20 AM:

There's a bug with this preset now where when you select a piece to drop no squares are highlighted as legal moves

Thanks for reporting this. It's now fixed.


The Fairychess Include File Tutorial. How to use the fairychess include file to program games for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Thu, Jan 12, 2023 05:55 PM UTC in reply to H. G. Muller from 08:42 AM:

Very nice that you can simplify your stalemate routine in the fairychess include file

It was more extensive than one routine, and it wasn't about simplifying it. As my previous comment indicated, this was about removing the cause of error in that routine and others with similar code. The problem was that using two separate variables for storing the legal moves had allowed bugs to creep into existing code.

but please don't do it in such a way that it breaks presets of others through changing the underlying behaviour of GAME code or Game Courier.

I kept on top of what needed to be fixed, and I fixed everything in a timely manner. There was some delay in fixing betza.txt, because it is not in the includes directory, and I didn't see the bug report on it until my computer was off, and I was in bed with my Likebook Mars. Now that you're an editor, I suggest that you move betza.txt to the /includes/ directory and replace the other ones with stubs that just include it from the includes directory.

So if you want an array that contains the legal moves as text rather than coordinates, and also contains special moves, just give it a new name, and use it by that name in the user code

What I wanted was for the $legalmoves array to contain all the legal moves, because various stalemated subroutines were using setlegal to build a list of legal moves and then checking whether there were any legal moves by checking the count of $legalmoves with a line like this:

return cond count system legalmoves false true;

The bug I described earlier was caused by splitting the legal moves between two variables. The $extralegal array was a kludge I created for the sake of storing some legal moves as strings while storing other legal moves as coordinate pairs. However, I was combining them into a new array called $legalList for use with forms and JavaScript, and this array listed all legal moves as strings. Creating another array would not have helped with anything.


A Wizard for GAME-Code Generation. A tutorial on using the Play-Test Applet for automating Game Courier presets.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Thu, Jan 12, 2023 02:24 PM UTC in reply to Daniel Zacharias from 03:44 AM:

Generated-code games are now giving an error saying "You may not set $extralegal with setsystem."

That's now fixed. I changed the line setsystem extralegal #xtl; in betza.txt to setsystem legalmoves merge $legalmoves #xtl;. Since $extralegal did not appear in any individual presets using this include file, nothing more needed to be done.


About Game Courier. Web-based system for playing many different variants by email or in real-time.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Thu, Jan 12, 2023 01:58 PM UTC in reply to Daniel Zacharias from 03:54 AM:

The problems with Hexagonal Chess and Napoleonic Chess are now fixed.


Hannibal Chess (GC preset with enforced rules). A Game Courier Preset for Hannibal Chess with enforced rules.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Thu, Jan 12, 2023 12:11 AM UTC in reply to Kevin Pacey from Wed Jan 11 09:44 PM:

That's now fixed. Since finished games have no legal moves left, $legalmoves was null, and then $legalList got assigned to null, which threw a fatal error a little further down. It now gets assigned to an empty array if $legalmoves is null, which allows things to work correctly.


🕸Fergus Duniho wrote on Wed, Jan 11, 2023 06:31 PM UTC in reply to Kevin Pacey from 06:02 PM:

I did not encounter the same problem. It could have been a temporary bug I introduced while streamlining how legal moves are stored just earlier today.


Shatranji. Chessgi with Shatranj pieces.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Wed, Jan 11, 2023 06:30 PM UTC in reply to Kevin Pacey from 06:07 PM:

There may be a problem affecting more than one preset's code, possibly. When I try to move Black pawn e7 to e6 in the following log the preset won't let me for some reason:

I did not encounter the same problem. It could have been a temporary bug I introduced while streamlining how legal moves are stored just earlier today.


The Fairychess Include File Tutorial. How to use the fairychess include file to program games for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Wed, Jan 11, 2023 06:27 PM UTC:

Because GAME Code was storing legal moves in two separate variables, and I wasn't always keeping this in mind, the stalemated subroutine in the fairychess include file was returning the wrong result for positions like this one:

It was claiming this was checkmate when the check could be prevented by capturing the Queen with a Pawn or blocking with one on g1. This was because the Pawn moves, which included a promotion, were being stored in $extralegal instead of in $legalmoves, which stored legal moves only as coordinate pairs, and the stalemated subroutine, as well as other similar subroutines, checked only the value of $legalmoves. To keep things simpler, I abolished the $extralegal variable, and I stored all legal moves in $legalmoves as strings using notation, and not as arrays of coordinates. With this change made, I was able to slim down the findmates subroutine to this:

// Finds each mating move in current position.
// Parameters:
// side: which side is moving
sub findmates side:
    local enemyking king mates moves mv;

    if match #side 1 white White first:
        set king #Kpos;
        set enemyking #kpos;
    else:
        set king #kpos;
        set enemyking #Kpos;
    endif;
    set mates ();
    ban none;
    setsystem maxmove 0;
    store main;
    setsystem legalmoves ();
    if not sub stalemated #king:
        set lglmvs $legalmoves;
        foreach move #lglmvs:
            set moves explode chr 59 #move;
            foreach mv #moves:
                set mv trim #mv;
                eval "MOVE: {#mv}";
            next;
            if sub checked #enemyking:
                setsystem legalmoves ();
                if sub stalemated #enemyking:
                    push mates #move;
                endif;
            endif;
            restore main;
        next;
    endif;
    setsystem legalmoves #mates;
endsub;

I did notice and correct one problem after this. It was recording some moves as belonging to the @ piece, which is the piece symbol used for empty spaces. This was because it was running the function for converting to notation as soon as setlegal was called, which happened to come before restoring the position. To correct for this, I had it get the piece type from the destination space if the origin space was empty, and if both were empty to not include the piece type. In the future, it would help to call setlegal only after restoring the position or to explicitly spell out the move if it will be anything out of the ordinary.


25 comments displayed

LatestLater Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.