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 ]

Comments/Ratings for a Single Item

Earlier Reverse Order Later
Game Courier History. History of the Chess Variants Game Courier PBM system.[All Comments] [Add Comment or Rating]
stephane burkhart wrote on Wed, Jun 13, 2007 07:12 PM UTC:
I would appreciate to see my game 'mapped chess' in Game translation, but
the task looks too heavy for me. As It took me quite a time to developp it
in ZoG format, I would be happy with an automatic translator zrf->Game.
Did you already think about it ?

George Duke wrote on Fri, Jun 15, 2007 05:01 PM UTC:
Several of my games around March 2007 were posted Win for my opponent, and they were definitely not timed or finished games, just delayed moves of 2 or 3 or 4 weeks. My concurrent Kibitz Comment shows Falcon Chess game in progress removed to finished game after my move minutes ago, win 'JeJu'(loss Duke). What happened? I just made my next move 18, or 20, whatever, Rook to e8 Check. Thank you in advance for continuing the game, JeJu, or by way of Editor.

🕸💡📝Fergus Duniho wrote on Tue, May 1, 2012 01:40 PM UTC:
Since I've been neglecting the History page of late, I've decided I should post about changes to Game Courier on this page rather than on other pages. I have recently been focusing on revamping the whole site, writing new headers for all pages on this site. The pages in the play subdomain have a different header than the pages in the main domain, but the two headers share features in common. They both have a site menu on the left, and they both have forms to login or a personal menu on the right. The site menu on the left often includes a Related Pages submenu whose contents varies from page to page.

In the play subdomain, I have been integrating the functionality of these menus with Game Courier. The buttons that used to appear at the top of Game Courier near the board have been removed, and their links have been placed in the menus. The site menu includes a Game Courier submenu with most of these links. The link to the rules and the link to the specific preset you are using have been moved to the Related Pages submenu. The URL provided for the rules is used to determine the ItemID to use for the Related Pages submenu, so that it gives you pages related to the game you're playing instead of pages related to Game Courier. This includes a submenu for games by the same inventor and a submenu for presets by the same programmer. Both of these are identified with the person's name, so that credits for the game and preset appear in the Related Pages submenu. There may be two inventor submenus when a game has a co-inventor. These menus may help direct you to other games you would like, and when there is a bug in a preset, the "Coded by" submenu identifies who you should contact about it. The "Your Games" link appears in the personal menu when you are signed in, and a "Your Games" link also appears on the page when you have just sent a move.

🕸💡📝Fergus Duniho wrote on Thu, Jul 19, 2012 04:54 PM UTC:
I have added a new feature to Game Courier. It was designed with tablets in mind, but it may also be used with a monitor. There is now a play mode, designed for using your tablet or monitor as a game board while playing against someone at your physical location. It is similar to solitaire mode, which could be used for the same purpose, except that it removes the header and other text above the board, including echo text, so that the board remains in a fixed position without any need to scroll the screen to see all of it, and it keeps the board in a fixed orientation. Before using it, you should customize the board to fit your screen. Because it uses the server, it requires an internet connection. You might use it to play chess variants with a friend in various locations, such as study hall, home, church, a library, a cafe, the back seat of a car, etc.

🕸💡📝Fergus Duniho wrote on Wed, Aug 1, 2012 01:11 AM UTC:
I have added a new feature to tablet play. When you're playing with the Play form, and your browser's user agent string reveals that you are using a tablet, it will turn pieces upsidedown for the second player. This allows you and your opponent to sit on opposite sides of the same tablet and each see the pieces from your own orientation when it is your turn. This will also give you a visual cue that it is your turn.

Note that this works only for pieces that do not normally flip. It will not flip Shogi pieces. Otherwise, they would have the wrong orientation. Since the visual cue of flipping the pieces is not available for Shogi, it also mentions whose turn it is to move underneath the form.

If you don't want pieces to flip, because you and your opponent are looking at your tablet from the same orientation, you can turn it off by changing your browser's user agent to one for a desktop. If your user agent includes one of these keywords--Android, iPad, Tablet, or Mobile--in any case, it will flip pieces for the second player. If these keywords are all missing from your user agent, then it will not flip the pieces. On both the iPad and Android tablets, you can get browsers that let you change the user agent. On the Android, these include Boat Browser, Dolphin, and Opera. The iPad also has Dolphin and Opera, and I tested Dolphin. On the iPad, Dolphin avoids the term user agent, but it lets you turn desktop mode on or off. When it's off, pieces flip, and when it is on, they don't.

🕸💡📝Fergus Duniho wrote on Sat, Mar 2, 2013 03:28 AM UTC:
I have begun to make Game Courier maximize the board size on mobile devices. Using window dimensions provided by cookies set with JavaScript, it automatically sets a scaling factor for grid-based boards rendered as images. This scaling factor is set to allow the board to be as large as it can on a mobile screen, and it overrides the value normally set for Scale. The device should be turned to the orientation (landscape or portrait) that best fits the board. It will usually be too big for one orientation but fit well in the other. Until cookies are set, it will sometimes be necessary to refresh the page until board size changes to fit the screen.

If you don't want to use this feature, you can render a board as a table or as CSS, or you can change the user agent for your browser so that it doesn't get recognized as a mobile device.

Here are technical details. Two cookies are kept, one for the landscape dimensions, and one for the portrait dimensions. Only one cookie will be set at a time, that being the one matching your tablet's orientation. For boards that are wider than they are tall, such as for Shogi, Crazyhouse, and 10x8 boards, the landscape dimensions will be used to find the best fit for the board. For boards that are taller than they are wide, such as Chinese Chess, the portrait dimensions will be used. When the appropriate dimensions are not available, it will make do with dimensions for the other orientation, switching the width and height. When no cookies are available, it will not resize the board, and it will allow zooming by touch. Otherwise, so that it can resize the board appropriately, it will disable zooming by touch.

Ideally, I would like to set the zooming factor, so that it works for any board rendering. But it gets complicated, because I don't have all the information on board size until after the zooming factor gets set in the meta tag, but what I've tried hasn't worked. So, instead, it makes use of Game Courier's ability to resize boards rendered as images. Alternately, I would like to use CSS to resize the board, but the CSS that resizes an image does not resize the AREA MAP that covers it. Maybe I could use CSS to resize a CSS rendered board, but then I would have to resize the pieces too. If I did that, I suppose I could use CSS to change the sizes of pieces on table boards too. It's something to look into down the line.

🕸💡📝Fergus Duniho wrote on Tue, Mar 5, 2013 12:49 AM UTC:
Instead of trying to make one solution fit all rendering methods, I have begun to implement scaling for every rendering method that didn't already have it. The PNG, GIF, and JPG methods already had scaling. These methods resize the image generated for the diagram. For boards rendered as tables, it changes the width and height values for table cells and piece images. This is all done in HTML without affecting the graphics used to display the pieces, allowing them to be cached and reused. For boards rendered with CSS, CSS is used to resize the board, and adjusted width and height values in the IMG tag are used to resize the pieces. I tried a purer CSS solution at first, but it had glitches. Like scaling with tables, this does all the rescaling by changing the HTML, not by making new graphic images. As was originally intended with CSS rendering, this allows the same graphics to be cached and reused. Finally, ASCII rendered boards are rescaled by adjusting the point size. Since this is done with CSS, I don't know if it will work with Lynx.

I have not yet implemented scaling for every board shape, and I have not yet made use of the rescaling for optimizing the board display in mobile devices. I'll do this in due time.

🕸💡📝Fergus Duniho wrote on Thu, Mar 7, 2013 04:43 AM UTC:
I have added some more fonts to Game Courier, these being Arial, Plantin, Baskerville Classico, New Times Roman, Palatino, Chicago, Topaz New, and Georgia. I have also begun to modify the CSS and Table rendering methods to use fonts. Unlike the PNG, JPG and GIF methods, these require fonts to be on your computer. Instead of using a font on the web site, they set the value of font-family to a list of font names, usually ending with serif, sans-serif, or monospace. I added some of the new fonts, because they are common in either Windows or Macs. Topaz New is based on the most common Amiga font. Plantin is generally my favorite serif font, and Baskerville is generally another favorite. This provided a larger set of web safe fonts. I then added the names of known and hypothetical lookalikes.

🕸💡📝Fergus Duniho wrote on Thu, Mar 7, 2013 10:19 PM UTC:
After comparing the fonts, I have removed Nadine and Times New Roman. Nadine is a wide, bold version of Plantin, which lacks Plantin's elegance. Times New Roman is very close to Centime, and where they differ, I prefer Centime. Instances where Nadine was used will be replaced with Plantin. Since I added Times New Roman only last night, I assume I don't have to correct for instances where it is used. In the font lists used for client side fonts, Times New Roman, along with Times, is included as a substitute for Centime, and Nadine is included as a substitute for Plantin after the Plantin lookalike Aldine 721 BT.

🕸💡📝Fergus Duniho wrote on Thu, Mar 7, 2013 10:40 PM UTC:
I've also removed Arial for being too close to Helvetica.

🕸💡📝Fergus Duniho wrote on Sat, Mar 9, 2013 04:39 AM UTC:
I have removed support for drawing hexagonal boards as HTML tables. This method existed only because I made it before I came up with better ways to render hexagonal boards. It appears to be broken anyway, and I was already recommending against using it. I have removed mention of it from the documentation. Any games that did render hexagonal boards as HTML tables will now render them as GIF files.

I have also removed support for using the square shape with the CSS method. When this combination appears, the grid shape will be substituted. This works virtually the same, since the default values for nextfile and nextrank match the sizes of the squares in the tiled backgrounds. This fixed a bug caused by changing the shape in Shogi from grid to square.

I made this change to Shogi, because I also fixed how square boards get rendered as graphic images. When a rank or file has a null space for a marker, its height or width gets reduced to the Border Size, and nothing gets displayed in it. This allows the PNG, JPG, and GIF methods to produce output that looks more like the output of the Table method. Since the default preset for Shogi uses the Table method, and its default background image does not match the table results, I changed its shape to square, so that when a user selects PNG, JPG, or GIF without changing the shape, the board won't suddenly look completely different.

🕸💡📝Fergus Duniho wrote on Fri, May 2, 2014 05:27 PM UTC:
I fixed up how Game Courier was displaying Shogi boards. Unlike most of the boards here, some of the boards I made for Shogi have coordinates written on them. This throws off the symmetry of the boards. The normal assumption for any board image is that the playing area is centered in the board image. But the playing area is not centered in the board images for Shogi with coordinates already drawn on them. For these boards, I manually adjusted the $offy variable, which is normally calculated on the assumption that the playing area is centered, and I set up a flag called $drawcoordinates, which can be set to false for these boards.

I could not find a perfect value for $offy, though, because some Shogi pieces are optimized, and some are not. All the ones I made are optimized, meaning that the image file does not include anything above, below, or to the sides of the piece image. But I've also included Kinki and Ryoko images, which are all the same dimensions, irrespective of the piece size. And I can't easily optimize these, since the images include shading, so that the area outside the piece is not a single uniform color. So I have compromised on a value for $offy that roughly centers the optimized pieces and keeps the Kinki and Ryoko pieces from spilling onto neighboring spaces.

Another issue with the Shogi boards was that I made boards in two sizes. Besides the ones with coordinates, I made some without coordinates, which have narrower spaces between the board and the off-board areas. So the code now recognizes which size board is being used for Shogi and adjusts the file widths accordingly.

When playing Shogi or other games using the same boards, you can now choose from all the Shogi boards available. Since boards with coordinates are paired with upside-down versions with the coordinates right-side up, the list now includes only one board from each list of paired boards. Depending on your side, the appropriate board will be used.

Finally, I updated the code for customizing boards when playing, moving pieces, or viewing a game.

🕸💡📝Fergus Duniho wrote on Mon, May 5, 2014 05:29 PM UTC:
I may have lost some code for scaling, due to needing to replace my computer and/or SSD, then uploading old files. So I'm continuing to work on code for scaling again. I have just added code to draw_grid_css.php for scaling. Since this is for the CSS rendering method, I have used CSS for scaling. It scales with the transform: scale(x,y) property. When it scales larger, I put another DIV around it to fix problems with text flow around it. This should work in browsers supporting transform, which include Internet Explorer 10 and Firefox.

🕸💡📝Fergus Duniho wrote on Mon, May 5, 2014 07:34 PM UTC:
I added scaling to draw_square_table.php. This works by adjusting HEIGHT and WIDTH values for table cells and images. I temporarily had a problem with it, but it was due to switching height and width measurements. It now works fine.

🕸💡📝Fergus Duniho wrote on Thu, May 15, 2014 06:19 PM UTC:
I have added a Resign button to the form for moving. It will submit the form with "resign" as the move. As with any other move, you will still have to verify that you intend this as your move.

🕸💡📝Fergus Duniho wrote on Sat, May 17, 2014 01:19 AM UTC:
Today I have been working on making Game Courier more mobile-friendly. I have programmed most boards rendered as tables or images to resize to fit the screen on a mobile device. For this to work, the browser must request the mobile version. Tablet browsers give you the option of seeing the desktop version, and if you do, it will not automatically resize the board. I have been testing it on my Kindle Touch, and the main problem I've been having is that the Kindle's browser will resize the whole screen to fit everything in it. So if some page element makes the screen too wide, it will cause the board image to appear smaller. So I have been working on removing or changing page elements that require more screen width. I have removed file paths from the footer, and for the mobile version, I have broken up form elements into shorter lines, and I have removed the comments from the footer.

I have plans for making all boards automatically resize, and for adding links for making and reading comments to the menu.

I do not have a cell phone. If you have one, it would help me out if you would let me know how it works on your cell phone.

🕸💡📝Fergus Duniho wrote on Tue, Nov 17, 2015 03:26 AM UTC:

I have started to implement the ability for Game Courier to show you your legal moves and to use JavaScript to catch and prevent illegal moves. This will work only for games for which the rules have been programmed in GAME Code. Support for this must be added on an individual basis, and so far, only boards of squares displayed as tables are supported. At present, I have it working for only one game. This is my second preset for Chess. It seems to work well except that it doesn't yet recognize castling moves. Once that is fixed, I will implement it in other games and explain how other developers can add this ability to their games.


🕸💡📝Fergus Duniho wrote on Tue, Nov 17, 2015 04:40 PM UTC:
It now works for castling, and I have added support for CSS. It works by using a GAME Code subroutine to make an array of all legal moves. This subroutine is based on the stalemated subroutine and may be used in place of it. The difference is it goes through all possible moves, while the stalemated subroutine would exit as soon as it found one legal move. To use it in place of the stalemated subroutine, you need to add a not. So, "not sub legalmoves" can be used in place of "sub stalemated" when checking for checkmate or stalemate. On second thought, I could replace the stalemated subroutine with a modified version of legalmoves that reverses the return value. This would make implementation of this into multiple games quicker, because the presets themselves wouldn't have to be rewritten to use legalmoves instead of stalemated. Still, care will have to be taken to make sure the subroutine used in a particular game matches its rules exactly. Since the legalmoves subroutine goes through all possible moves, including castling, which had been skipped by stalemated, it may need more finetuning for specific games. Since it makes this array using the rules of a game programmed in GAME Code, this option will not be available for a game unless its rules have been programmed.

Each entry in the array is an array of two coordinates. The first is the origin of the move, and the second is the destination. PHP copies this array into JavaScript, which then uses it to know which spaces a piece may move to. It uses this information to display the spaces a piece may legally move to, and it uses it to catch and prevent illegal moves. This will only work for moves made with the mouse. Any move may still be entered manually, and if it is, it will be up to the GAME code program to evaluate the legality of the move. When a game's rules have not been programmed, and the legalMoves array in JavaScript is null, it will not display legal moves, and it will allow any move.

🕸💡📝Fergus Duniho wrote on Wed, Nov 18, 2015 04:40 PM UTC:
Displaying legal moves now works for games displayed as images, including hexagonal boards. Now that I have added support for all major types of rendering, it should be quicker to add support for custom shapes.

🕸💡📝Fergus Duniho wrote on Sat, Nov 21, 2015 08:52 PM UTC:

For boards using squares, the last move made should now be highlighted. A dotted border will be over the vacated space, and a solid double border will be around the piece that just moved.


🕸💡📝Fergus Duniho wrote on Wed, Dec 2, 2015 03:06 AM UTC:
I added a "Run" button to Edit mode. This will run the code without making any moves, and it will display any output at the top of the page. This output would normally be hidden when playing games, though visible in the source code. The "Run" button is mainly for using the Pre-Game Code area as a place to test code without going through extra steps of saving the code, going to the menu, and then starting to play a game just to see what the code does. Now you can just click "Run" to see what your code does.

🕸💡📝Fergus Duniho wrote on Thu, Dec 3, 2015 01:05 AM UTC:

I am extending GAME Code to better support Lambda functions. This is an anonymous, unnamed function. I have created a new variable type for storing functions. Although a function is simply stored as an array, I wanted to know when an array is supposed to be a function. So I created a PHP class called Lambda, which holds an array that represents a function.

I created the lambda operator for expressions. This will convert an array, a string, or the function associated with a function name to a Lambda object. This can be used with the fn operator to run a Lambda object as a function.

One immediate consequence of this is that you can store functions in variables, and you can call a function with a variable instead of a function name. For example:

set a lambda (* #0 #1);
set b fn #a 6 8;

The second line multiplies 6 by 8 and sets b to 48.

I am also working on expanding some built-in functions to make lambda functions more useful. Here's an example of an expression using a lambda function to find the location of the Black King:

set k anytrue lambda (#0 onlyif == space #0 k) spaces;

The anytrue function, if given a lambda function as its first argument, goes through all the values of an array given as a second argument, calling the function for each value in the array until it finds a true value. The value from the array goes into #0. If the array element is an array itself, the function may have more than one argument. For example:

set k anytrue lambda (#0 onlyif == space #0 #1) ((e1 k) (e8 k) (g1 N));

Because a string can be converted to a lambda function, it is now possible for the program to write a function and call it. More on this later


🕸💡📝Fergus Duniho wrote on Tue, Dec 29, 2015 11:15 PM UTC:
I redesigned the form for inviting someone to play a game, I deprecated the Pace time control setting, leaving it out of the form, and I updated the automatic time control settings.

🕸💡📝Fergus Duniho wrote on Fri, Apr 1, 2016 07:33 PM UTC:
Because it looks like many invitations have not been going to the cvgameroom of late, I modified Game Courier to send email from the play@chessvariants.com address unless "Allow scripts to forge my email address when sending email on my behalf" is checked in your profile. My hypothesis for why the cvgameroom wasn't getting any emails was that it had started to block emails forged from this site. And it looks like I was correct. The emails it sent from play@chessvariants.com when I just issued some invitations all made it to the group. Since email from this address is coming from its own domain, it is not being detected as forged, and it gets through.

Also, using this address will help keep the email addresses of player's away from bots that harvest email addresses for spam, and this greater privacy may encourage more people to use Game Courier.

The play@chessvariants.com address is only for sending email from Game Courier. It is not intended for receiving email or for sending personal emails. That's why it's okay for me to mention it many times in this message.

🕸💡📝Fergus Duniho wrote on Sat, Apr 2, 2016 09:00 PM UTC:
If you have written Game Courier presets, you may now post a written description of the rules. Game Courier's Edit mode includes a new form field for this. You may write your description of the rules in HTML. So that you may display piece images that match the current set, you may use the showpiece.php script with the piece parameter as an image URL in an IMG tag. The piece parameter should match the piece label used by the set. This script also takes a set parameter, but Game Courier will add this one in automatically.

This same script may also be used to display piece images on rules pages. Just enter both the set and piece parameters when you use it that way.

🕸💡📝Fergus Duniho wrote on Tue, Apr 12, 2016 03:11 PM UTC:
The Preview and Verify mode now has a Cancel button. This is like clicking the back button, but it preserves any comments you have written, and if you're in a multi-move game, such as Extra Move Chess, it will cancel the whole move at once. The main reason I added this was because I didn't like having my comments go away every time I decided against a move.

Joe Joyce wrote on Wed, Apr 13, 2016 11:10 PM UTC:
"Fergus Duniho Verified as Fergus Duniho wrote on 2016-04-12 None

The Preview and Verify mode now has a Cancel button. This is like clicking the back button, but it preserves any comments you have written, and if you're in a multi-move game, such as Extra Move Chess, it will cancel the whole move at once. The main reason I added this was because I didn't like having my comments go away every time I decided against a move."

Thank you very much - I got burned by that little feature more than once myself. I'm sure others have, also. I like what's been happening here lately.

🕸💡📝Fergus Duniho wrote on Wed, Apr 27, 2016 02:20 PM UTC:
Since deleting old settings files would break the games that used them, and completely replacing them with new code could also break the games that used them, I added the ability to deprecate an old settings file. To deprecate an old settings file, go to Edit mode and enter the name of another settings file to redirect new invitations to. This will allow the settings file to be used when viewing games already played using it, but it will direct new invitations to the preferred settings file. This is useful when you change the rules or setup of a game or when you program a game in a way that will not work with notation used when previously playing the game with another settings file.

Greg Strong wrote on Wed, Apr 27, 2016 02:58 PM UTC:
Excellent, thanks you for this.  Just what I needed!

🕸💡📝Fergus Duniho wrote on Wed, Apr 27, 2016 06:30 PM UTC:
I have now written a script for keeping track of all the settings files you have written. It is at

http://play.chessvariants.com/pbmsettings/index.php

It provides some useful information for determining which ones you may want to edit or deprecate. It sorts files for the same game by date, and it tells you how many fields for GAME Code are filled in.

🕸💡📝Fergus Duniho wrote on Thu, May 12, 2016 03:54 PM UTC:
After exposure to Jocly's distinction between model and view, I realized that the same distinction was implicit in Game Courier, but I hadn't made it as explicit. So I have now reorganized Edit mode to reflect the same kind of distinction. I have split what Jocly calls the model into two different sections. These are Structure and Code. The structure of a game is its coordinate system and its location of pieces. The code is where automation and rule-enforcement are handled. The code has to regularly refer to the structure of the game to interpret, evaluate, and make moves.

What Jocly calls the view, I'm calling Appearance. These are details that affect how the game looks. In general, the code has nothing to do with appearance, and it should not be allowed to change it, but, for the most part, details of appearance should be user-configurable. The main exception to this is the shape of the board. This will have an impact on the rules, which the code needs to handle, and except for changing between squares and custom grid, it should not be user-configurable. But the code does not need to know the value of this field to process moves, and changing it should have no effect on the game logic.

While doing this reorganization, I have also linked each field to the appropriate entry in the Developer's Guide, and I have placed a brief description of it in the link's TITLE field, which you can view by hovering over it. Edit mode is currently showing all fields. I will fix this later.

🕸💡📝Fergus Duniho wrote on Sun, Jun 5, 2016 02:07 AM UTC:

I have taken a big step toward making Game Courier more suitable for games played in real-time. I have removed the automatic page refreshing when you hit the Continue button, and I have replaced this with a bit of AJAX that periodically checks whether it is your turn again, then refreshes the page once it is your turn again. I still have more things to do to better support real-time play. One is to include a starting time in invitations for real-time games. Another is to add an audible alert when it is your turn again. I might include a selection of sounds and give players a choice.


🕸💡📝Fergus Duniho wrote on Wed, Jun 8, 2016 12:12 AM UTC:

There are now animated clocks, and you can watch games live. The clocks appear in timed games above and below the board. The one below the board is for the player whose turn it is to move, and, as long as JavaScript is on, this one counts down one second at a time. It shows days as a serif number on a white square and hours, minutes, and seconds in a digital clock font (DSEG7 Classic Bold from http://www.keshikan.net/fonts-e.html). The number of days will not show up unless greater than zero. The hours, minutes, and seconds appear in green so long as only grace time is being used, and they change to yellow when grace time is used up, and time is being lost for real. The clock for the opponent of the current player appears at the top, and its hours, minutes, and seconds appear in red. The color coding is by traffic light colors. Red is for the player who is stopped, and green and yellow are for the player who can go.

When you view a game you're not playing, and you're viewing the latest move, the page will update whenever a new move is made. JavaScript must be on for this to work. This allows you to view games live, watching the moves as they're being made.


Greg Strong wrote on Fri, Jun 10, 2016 03:46 PM UTC:

When making the first move on a multi-move variant, the border color and text color are now reverting to black.


🕸💡📝Fergus Duniho wrote on Sat, Jun 11, 2016 12:24 AM UTC:

Game Courier will now display the captured pieces. By default, this works by making a list of pieces in the starting position, subtracting from the list any piece on the board in the latest position, and displaying the pieces still left in the list after sorting them in case-sensitive alphabetical order. Since this is not always appropriate for every game, how or whether Game Courier displays captured pieces can also be controlled with GAME Code for individual games. To display captured pieces, Game Courier populates an associative array called $capturedpieces. This array takes pieces labels as keys and piece counts as values. This variable can be set with setsystem to an array calculated with GAME Code, or it can be set to false, which will cause no captured pieces to be displayed. This is appropriate for games with drops, such as Shogi, which already display captured pieces in the playing area.


🕸💡📝Fergus Duniho wrote on Sat, Jun 11, 2016 01:41 AM UTC:

The problem with the border and text colors was more general than anything to do with double move variants. Tying this back into the history of Game Courier, I am currently studying HTML5, and I am trying out new ways to improve the forms with the use of new features in HTML5. One of these is the color type for the input element. This displays the color instead of its name or hexadecimal code, and it provides a color selector, like what you may find in a graphics program. But when I changed the input fields for the border and text colors to the color type, I learned that it expected the color code to begin with a #, and I had been allowing color codes without it. To fix this, I used a regular expression to test whether the pre-existing value PHP would populate the form with was a six-digit hexadecimal number without a preceding #, and if it was to add one. But I had forgotten to begin and end this regular expression with ^ and $, which caused it to return true for values that already had a preceding #, causing it to add an extra one, which caused the color to change to black.

The addition of the text color is new and incomplete. I think I still have to go through the scripts for displaying the board and change how they access the text color.


🕸💡📝Fergus Duniho wrote on Sat, Jul 16, 2016 11:44 PM UTC:

When a GAME Code program displays a message with the say command, it will now also insert the message as an inline comment for the current move. To distinguish it from user-entered comments, it will surround it with two hyphens. In games I have coded, this will add comments for check, checkmate, stalemate, and draws. It can also be put to other uses.


🕸💡📝Fergus Duniho wrote on Mon, Jul 3, 2017 03:06 PM UTC:

Although Game Courier cannot fully analyze GAME Code to tell whether it fully enforces the rules of the game, I have given it the ability to more accurately estimate which presets enforce rules and which don't. One new thing that helps with this is the ability to display legal moves. When a preset has been programmed to display legal moves, it will populate an array of legal moves. So, if this array exists and has something in it, then it can display legal moves, and it very likely enforces them too. Besides checking this, Game Courier checks which code blocks are populated with code. If they're all empty, then it can be known for sure that there is no rule enforcement. If the post-move blocks are empty, odds are good that it doesn't enforce rules, and if the post-game blocks are empty, it's expected that it does not spot check, checkmate, or stalemate. One more thing is that it checks the post-game code for the strings check and stalemate. If it finds one of these in both, then it is assumed that it includes code for spotting check, checkmate, or stalemate, and this is taken as a good indication that full rule enforcement is present.

Based on this analysis, Game Courier will include a message above the board before a game begins to let you know what its capabilities appear to be. If you have programmed a game, you may bypass this and inform potential players of your preset's capabilities with even more certainty by including something like this in your pre-game code:

if == thismove null:
  say This preset enforces the rules and displays legal moves.;
endif;

By running the say command only when thismove is null, this message gets passed to it only at the beginning of the game before any moves have been made.


🕸💡📝Fergus Duniho wrote on Sat, Aug 26, 2017 03:18 PM UTC:

For games that can display legal moves, the ability to display legal moves is now extended to View and Preview modes in a user-friendly way. When you touch or click on a piece, it will show you how that piece can move. When you click an empty space, it will clear any markers that have been displaying legal moves for a piece. This can be particularly useful in Preview mode, because it will let you see how your opponent would be able to move if you go through with the move you are previewing. It will also enhance View mode by letting you see how the current player to move can move.


🕸💡📝Fergus Duniho wrote on Thu, Aug 16, 2018 06:27 PM UTC:

Game Courier has now been modified to give an error message if it does not recognize the value of the Submit field when clicking on a form. This is because the use of Google Translate may change this value to something Game Courier does not recognize, and users should be notified of this error when it happens.


🕸💡📝Fergus Duniho wrote on Thu, Aug 16, 2018 11:06 PM UTC:

I have begun to replace buttons made with the INPUT tag with buttons made with the BUTTON tag. The BUTTON tag allows me to separate the display text from the form value, which allows the display text to be translated to another language without changing the value that will be passed by the form. I have already changed a few forms, and they are working correctly when translated.

I have also begun to add the notranslate class to some tags, so that translations do not mess up the data passed to the form, and so that coordinates display properly on translated pages.


🕸💡📝Fergus Duniho wrote on Wed, Aug 22, 2018 02:23 AM UTC:

Game Courier checks where GAME Code has been entered for a preset, whether there is a list of legal moves, and the value of the rules flag to determine the extent of a preset's rule enforcement, and it now displays this information below the board, just underneath the name of the game, which links to the rules page. It used to put this information above the board before a game began, and it didn't weigh in the value of the rules flag. It now displays it below the board during the course of a game. The rules flag can be set with the command "setflag rules;", typically in the pregame code. Setting this simply serves as a signal that the code you wrote actually does enforce the rules. It has no effect on the rest of your code, and it will not provide you with rule enforcement if you don't actually program it in.


🕸💡📝Fergus Duniho wrote on Tue, Nov 12, 2019 10:17 PM UTC:

I have added an Advanced section to the Edit form. This includes a couple options that can be checkmarked. One of them was already included in the Edit form. The new one is the option "Do Not Include Moves in Code." For most games, this option should not be checked. And for unprogrammed games, it should never be checked. It's useful if you handle the execution of moves within your code. What this does is stop Game Courier from automatically adding the moves in a game to the code it generates for the game. If your game is not programmed, the result is that moving pieces will not work.

I added this option, because when I castled in Marseillais Chess and then tried to move the Rook that had just castled, it wouldn't let me, giving me the error message that the Rook was not on the space I was trying to move it from. I realized this was happening, because it would automatically execute all the moves before evaluating any of them. But I didn't need to include that in my code, because my code for Marseillais Chess would normally undo the latest moves, then replay them individually. Given that it was already doing that, I could just remove the moves it was undoing. So, I added the option to remove them.


🕸💡📝Fergus Duniho wrote on Fri, Feb 7, 2020 01:31 PM UTC:

I have modified how constant values can be included in code. In the past, a constant could be used by preceding its name with the # sign, just the same way that variables can be used, and constant names would have higher precedence than variable names. This helped keep the value constant when the name was used for a constant. But I have decided that this is a bad practice, because it interferes with a function's ability to count on its local variables having higher precedence than anything else with the same name.

So, I have made two changes. First, the @ sign may now be used in place of the # sign to get a constant value. This works only for constants, and its use will make it clearer that a given name belongs to a constant. Second, the # sign may still be used to return a constant value, but it now has lower precedence than variables with the same name. This will provide backwards compatibility so long as your variables and constants do not use the same names.


Greg Strong wrote on Sat, Feb 8, 2020 12:04 AM UTC:

Very nice.  This, combined with the new fairychess include file, marks a definite step forward.  I'm glad to see GC code is continuing to be developed.  I was a little concerned that the change of precident could break some presets, but I just opened a large number of finished games and didn't see any issues.  Using constants and variables with the same name is probably uncommon.


🕸💡📝Fergus Duniho wrote on Sat, Feb 8, 2020 01:53 AM UTC:

I'm glad you like it. The changes I made to constants came about while I was working on the fairychess include file. Since I planned on using constants to associate piece labels with piece names, I wanted to avoid collisions between constants and variables with the same name. I did a grep search on the settings files and changed a few to use the @ sign instead. Just in case constants are used in presets that are defined in forms instead of settings files, or in case someone inadvertently uses # for constants in the future, I let it continue to be used that way but with lower precedence. Even without replacing # with @ in a few settings files, this would have been enough, because they normally did not use the same names for both variables and constants. But if I name constants after piece labels and also use short variable names in functions, collisions could arise. So, I wanted to separate the namespace between them.


🕸💡📝Fergus Duniho wrote on Sat, Feb 8, 2020 06:03 PM UTC:

I am deprecating the use of global and setglobal as aliases for system and setsystem. I would like to eventually eliminate these from the language, since global variables have a different meaning in the language.

I have limited the power of the system built-in function. While it had prevented people from viewing a password with it, it did allow you to enter "system GLOBALS" to view all the variables, which could be a big security risk. I changed it to return values only from a whitelisted set of system variables. These correspond to the same ones that may be set with setsystem.

I introduced the use of the dollar sign as a system variable designator. When appearing at the beginning of a variable name, it will return the value of the corresponding system variable if it has been whitelisted. I also added support for $old and $moved, which return the values of $lastcaptured and $lastmoved. Since the dollar sign is also the designator for PHP variables, it is basically a way to get the values for some of the PHP variables with the same name. You may also think of the S in $ as standing for system.

Game Courier is already set up to recognize old, moved, origin, and dest as values of system variables, but I don't like this, because it prevents these from being used as ordinary words, and it might make the code more confusing if you don't already know their meaning. The use of $old, $moved, $origin, and $dest should now be preferred, though I can't phase out the old way without rewrting lots of code. I have at least made the changes in the new fairychess settings file for Chess, so that they can be used going forward.


🕸💡📝Fergus Duniho wrote on Sat, Feb 8, 2020 07:54 PM UTC:

I have removed $countextrasas from the system variables. It was not used in any settings file, and I could not figure out what it was for. My comments on it were not informative enough. I commented out the code that used the variable, since it appeared to be useless.


Greg Strong wrote on Sat, Feb 8, 2020 11:14 PM UTC:

Since I am updating the GC presets for Opulent anyway for the new array, I am going to modify it to use the new fairychess include file.  To that end, I modified the include file to add a few new pieces.  I added Half_Duck and Knight_Wazir since Opulent requires those.  While I was at it, I added the three new pieces for Kevin's games that Aurelian has been working on: Elephant_Ferz, Elephant_Wazir, and Frog.

For reference, here are all the pieces currently supported by the fairychess include file (the notes in parenthesis are not part of the actual name):

Queen
Rook
Knight
Bishop
King
White_Pawn
Black_Pawn
White_Berolina_Pawn
Black_Berolina_Pawn
Cardinal (BN)
Marshall (RN)
Amazon (BRN)
Cannon
Vao
Wazir
Ferz
Camel
Camelrider
Dabbabah
Dabbabahrider
Elephant
Elephantrider
Nightrider
Dragon_Horse (BW)
Dragon_King (RF)
Eques_Rex (NFW)
Wizard (CF)
Champion (WDF)
Korean_Elephant
Chinese_Elephant
Giraffe (4,1 leaper)
Grasshopper
Short_Rook (R4)
Squirrel (NAD)
Spider (DA)
Spider-rider (DDAA)
Squire
Unicorn (BNN)
Zebra
Elephant_Ferz (FA)
Elephant_Wazir (WA)
Half_Duck (HFD)
Knight_Wazir (NW)
Frog (FH)
Griffon
Aanca
Leo (Cannon + Vao)
Mao
Moa
Murray_Lion

One small nit-pick, the Spider-rider has a dash while the other riders do not. Any objections if I correct this inconsistency?


🕸💡📝Fergus Duniho wrote on Sun, Feb 9, 2020 12:58 AM UTC:

The hyphen is in Spider-rider to separate the two adjacent r's.


🕸💡📝Fergus Duniho wrote on Sun, Feb 9, 2020 07:09 PM UTC:

I have added to the fairychess include file the Shogi and CWDA pieces that weren't already in it.


🕸💡📝Fergus Duniho wrote on Mon, Feb 10, 2020 02:05 AM UTC:

I'm working on adding piece descriptions to the fairychess include file. One reason for this is to help programmers using the include file find the code for the pieces they want. But instead of putting them into comments, I am creating strings that can be used in error messages to remind players how a piece moves. I started with the Chess pieces while I took the time to hone the code for displaying the messages. The strings use "%s" instead of the piece name in case someone renames a piece. I had thought of using printf, but I ended up using str_replace, which I added to the language. Like the PHP str_replace, its arguments are search, replace, and string.


🕸💡📝Fergus Duniho wrote on Sat, Jul 25, 2020 10:38 PM UTC:

I have completed some improvements in how arrays are handled. Elements of multi-dimensional arrays may now be specified by including periods in the variable name. Each period separates an array element from its parent array. For example, in #example.element, the parent array comes first, and the element comes second. Deep multi-dimensional arrays are also possible, such as #this.is.an.example.of.a.deep.multidimensional.array.element. You can now set array elements with set, and you can use the value of array elements as arguments to commands that do not evaluate expressions.

You can also use array elements with some commands that change their value. For example, if you kept track of captured pieces in an array called cp, inc cp.p would increment the number of captured Black Pawns.

You can also read the values of elements in system arrays, such as $originalpieces.p, which would return 8 in Chess.

You can also insert variables into array element names using {}. For example, the code below would increment the element of cp corresponding to the captured piece whenever a piece is captured.

if capture:
  inc cp.{$old};
endif;

The setelem command still works, but now it just concatenates the array name with the element name and calls setuservar(). Likewise, the elem operator still works, but when an array is given by variable name, it will concatenate the names and call getuservar();


🕸💡📝Fergus Duniho wrote on Wed, Jul 29, 2020 01:34 AM UTC:

I have made a few changes to GAME Code today:

  1. Functions will now evaluate variables when they are called, not when they are defined. In this example, the function x2 returns a different value each time:
def x2 * 2 #x;
set x 12;
print fn x2;
set x 23;
print fn x2;
  1. Functions now allow you to set named my scope variables. To do this, prepend a variable name with the = sign, and follow it with the value you want to copy to the variable. In the following example, the function copies "Chess Variant" to the variable v, and it doubles it. Both before and after calling the function, #v returns the value of "cartoon violence". This is because the function raised the scope, and the my scoped variables it created were destroyed when the function ended.
set v "cartoon violence";
def s2 list #v #v =v "Chess Variant";
print #v;
print fn s2;
print #v;

If more than one argument follows a variable assignment, they will be converted into an array, leaving nothing to the right of the assignment.

  1. Functions now accept named parameters. This works the same way as assigning a value to a variable except that no value follows the assignment. When no value follows the assignment, it pops off a value from the arguments passed to the function. In the example below, the output is 30, 110, and #x, because x has not been defined outside of the function:
def sqrplus + * #x #x #x =x;
print fn sqrplus 5;
print fn sqrplus 10;
print #x;

Numbered parameters will still work, since it would break way too much code if they stopped working. But numbered parameters will not work with named parameters. With numbered parameters, the exact number of arguments to expect is calculated. If too few arguments are given, there is an error message. If too many are given, only the ones that are needed get read and used. This allows code like this to make sense:

def mns - #0 #1;
def multdiff * fn mns #0 #1 #2;
print fn multdiff 5 11 10;

In the multdiff function, the call to mns has three arguments after it. It uses only the first two, leaving the third to be used as an argument for the * operator.

When you use named parameters, you will get an error message if there are not enough arguments. But if there are more than enough arguments, only the last arguments in the list will be used. In the code below, the first function call prints my name, but the second prints my uncle's.

def name list #first #last =first =last;
print fn name Fergus Duniho;
print fn name Fergus Patrick Duniho;

In general, you should avoid extra arguments when using named parameters, but this behavior may prove useful for creating functions that can take a variable number of arguments. To enable this, I have added the args operator, which returns an array of the remaining arguments. Named parameters will shrink the array of arguments by popping them off. So, if you pop them all off, args will be empty. But if you don't, you can do something like this:

def revwords list reverse args;
print fn revwords Fergus Duniho;
print fn revwords Fergus Patrick Duniho;

The revwords function can take a variable number of arguments. It reverses the order of the arguments and makes a string out of them. So, the two calls to the function output "Duniho Fergus" and "Duniho Patrick Fergus".


🕸💡📝Fergus Duniho wrote on Fri, Dec 11, 2020 02:15 AM UTC:

I previously made the variable prefixes recursive. This allows something like this:

set m Mars;
set p m;
echo ##p;

The expression ##p returns #m, which returns Mars. So, "echo ##p" prints Mars. While helpful, this breaks some code I previously used to check whether a variable has been set. This code no longer works:

set m Mars;
if == #m "#m":
  echo undefined;
else:
  echo #m;
endif;

When m is defined, #m should be its value, which is Mars, and "#m" should be the string "#m". But thanks to recursion of variable prefixes, or so I presume, the string "#m" is converted to #m, which is then converted to the value of m. So, the test == #m "#m" still returns true when m has been defined. This makes it useless for telling whether a variable has been defined.

In its place, you can use the test == var m null. When a variable is undefined, calling it with var instead of a prefix will return null. So, this code works properly:

set m Mars;
if == var m null:
  echo undefined;
else:
  echo #m;
endif;

H. G. Muller wrote on Sat, Dec 12, 2020 02:26 PM UTC:

Is it really a good idea to make this the default behavior? There probably are some situations where you want this recursion, but I cannot imagine you would always want it. I think it would be better to have the programmer explicitly indicate whether he wants it to happen, e.g. by having an operator different from # for it. E.g. when p is set to #m and m to "foo" then #p could return "#m" but dig p could return "foo".


🕸💡📝Fergus Duniho wrote on Mon, Dec 28, 2020 06:33 PM UTC:

I added an exit command, which immediately terminates the GAME Code program. It works by setting a flag that causes the run_subroutine() function to immediately return before doing anything, and then it returns. So, if you use it within a subroutine, it will return from that subroutine and then return from any lower scope that called it until it completely exits the GAME Code program. Note that this will affect only the GAME Code program and will not exit the PHP script.


🕸💡📝Fergus Duniho wrote on Fri, Mar 26, 2021 09:34 PM UTC:

I have begun adding the ability to create themes for games. A theme is a collection of settings that can be chosen together for the purpose of changing the appearance of a game. This makes changing the appearance of a game quicker and easier than doing it one setting at a time. When themes are available for a game, they will appear in a drop down select list just above where you can change individual settings. Any member may create and save a theme by going to the Customize section of the preset. Customize it how you want, enter a theme name, and click Save Theme. It will then be available for that game.

So far, I have made themes only for Shogi. I plan to do some Chess themes later and set things up for presets that use the same equipment as Chess to use the same themes. I also plan to provide the option for games to use the themes for another game instead of having its own. This will come in handy when different games use the same board and pieces and so can share the same themes. And I plan to set things up so that players can create themes without leaving their games. But I've done enough work on it for today, and what I've done today seems to be working.


Daniel Zacharias wrote on Fri, Mar 26, 2021 10:24 PM UTC in reply to Fergus Duniho from 09:34 PM:

Maybe themes should be shared among all games that use the same piece set and geometry


🕸💡📝Fergus Duniho wrote on Sat, Mar 27, 2021 01:54 AM UTC in reply to Fergus Duniho from Fri Mar 26 09:34 PM:

There are now Chess themes, and these will be used for any game on an 8x8 board whose pieces on the board are a subset of the pieces in Chess.


🕸💡📝Fergus Duniho wrote on Sat, Mar 27, 2021 06:25 PM UTC:

There are now themes for Chinese Chess, Janggi, and Chessgi. Chessgi themes will work for any game using the same type of board and a set from the Chess group. The Chess themes now work with any 8x8 game using a set from the Chess group instead of testing for a subset of the pieces in Chess. There are also Chess-Squares and Compounds-Squares for boards of varying dimensions built from the square shape or a 100x100 tile. These work with sets from the Chess and Compounds groups respectively.


🕸💡📝Fergus Duniho wrote on Mon, Mar 29, 2021 11:08 PM UTC:

I added themes for Storm the Ivory Tower and for Omega Chess. For the latter, I added the ability to erase non-space when using tiled background images. This let me use tiled background images for Omega Chess themes. These themes do not print the coordinates for the corner spaces, but they do show the coordinates if you hover the mouse over them.


🕸💡📝Fergus Duniho wrote on Wed, Mar 31, 2021 12:23 AM UTC:

Since the Compounds group had only two sets in it that didn't even match up, and one belonged to the Chess group anyway, I removed its members and replaced them with four new piece sets that do match, more or less. These four are drawn from the Abstract, Alfaerie, Magnetic, and Motif pieces. They are meant to consist only of pieces that can be made by using or recombining standard Chess piece images, particularly for Magnetic and Motif. Each one currently has all double compounds of King, Rook, Bishop, and Knight. The Amazon is the only triple compound. Compound pieces have two or three letter labels indicating the pieces they are compounds of. There is some redundancy regarding the Queen, using both q/Q and rb/RB for the Queen, since Fusion Chess uses the latter. This also carries over to the labels for the Amazon, which are qn/QN and rbn/RBN. I would like to add Ferz and Wazir pieces, some compounds with these, and some more triple compounds with these and/or the King. I'm still working on Ferz and Wazir designs. Some alternatives are to use smaller Rooks and Bishops, to mix the Rook and Bishop with Pawns, or to place the numeral 1 on modified Rooks and Bishops.


🕸💡📝Fergus Duniho wrote on Fri, May 7, 2021 05:42 PM UTC:

I modified the sets files to use relative URLs for the value of $dir. I modified some other code to work with relative URLs, and I added code that exits the script with an error if you use a value of $dir that does not begin with a forward slash. So, from now own, $dir should be set only to a relative URL to a directory on this site.

Using relative URLs has a few advantages:

  • Piece URLs will be shorter, using less bandwidth.
  • Insecure http image URLs will no longer be used, since relative URLs will default to secure https URLs.
  • No one will be able to use piece images that are located on another website.

In a related matter, $dir is now an accessible system variable in GAME Code. You may write to it with setsystem or get its value. This is useful for using GAME Code to create and use custom piece sets that are not defined in a PHP file. More details can be found here.


🕸💡📝Fergus Duniho wrote on Mon, Feb 7, 2022 06:18 PM UTC:

I made a correction to the handling of case statements. If multiple case labels were in the same case statement, it would previously check only if the first one was already assigned. It will now check whether every single case label has been assigned. If a case label has already been assigned in a switch, it will give an error message.

If a case label includes whitespace, it will now report an error message. This is in case a colon is left off a case statement, and a new line character gets included in the case label.

If a switch statement is passed a value that does not match any of its cases, and it has no default case, it will report an error message that neither the expected case nor a default case exist.

The print statement can now be used to print the value of an array, which will make it more useful for debugging.


A. M. DeWitt wrote on Tue, Mar 15, 2022 06:41 PM UTC in reply to Fergus Duniho from Mon Feb 7 06:18 PM:

It seems the new handling of case is interfering with the display of the Preset Editor, at least for me. The link below is an example.

Edit: Taishin Shogi on the Chess Variants Game Courier

There is a double space in the case statement on the line where the error is.


🕸💡📝Fergus Duniho wrote on Tue, Mar 15, 2022 07:52 PM UTC in reply to A. M. DeWitt from 06:41 PM:

It seems the new handling of case is interfering with the display of the Preset Editor, at least for me.

There is a double space in the case statement on the line where the error is.

The error message it gave wasn't quite accurate, because the actual string was the empty string, not one with whitespace in it. I modified it to skip over empty strings. So, it works now.


A. M. DeWitt wrote on Wed, Mar 16, 2022 05:29 PM UTC in reply to Fergus Duniho from Tue Mar 15 07:52 PM:

The editor is working again. Thanks.


🕸💡📝Fergus Duniho wrote on Fri, Apr 22, 2022 10:32 PM UTC:

Small palette board images with fewer than 256 colors that use the default colors can now be recolored like automatically generated boards. When the developer or user has chosen a different color than one of the default colors, the default color will be replaced by the new color in the image. For this to work, the original image must use the default colors, which are 339933, CCCC11, and 22BB22.


🕸💡📝Fergus Duniho wrote on Sun, May 12 08:53 PM UTC:

I made a change to the following functions that can run lambda functions on array values: aggregate, allfalse, nonetrue, alltrue, anyfalse, anytrue, any. These will now have access to the variable key, which will contain the key of the array value currently passed to the lambda function. This should be accessed with the var keyword to make sure that a previously defined variable is not being used.

To prevent expressions using these from changing the value of a previous variable called key, I had to raise the scope of every expression. But to get this to work, I had to rewrite each built-in function that exited the PHP function for evaluating expressions with a return. Instead of using return, I had each one set $output to a single element array with the return value, and I set $input to an empty array so that the condition on the while loop would be false. Doing this makes sure that it decrements the scope before exiting the function.

Raising the scope of an expression also makes sure that the mechanism for adding named variables to a function cannot be used in an expression to set a variable that lasts beyond the expression. The following code prints 6468, then it prints 63. This is because it raises the scope for the assignments in the expression, and when it completes the expression, it closes that scope.

set o 9;
set y 7;
set pp * var o var y =o 98 =y 66;
echo #pp;
print * #o #y;

70 comments displayed

Earlier Reverse Order Later

Permalink to the exact comments currently displayed.