\author Raymond St. Marie II \title RxChess0.0.2 \copyright (pd)2006 \format-html rdml.css \b RxChess0.0.2 for \b RetroForth \t Overview \p \b RxChess is a chess game. It plays in the current \link http://retroforth.org/#download RetroForth version. \p There is a menu/help system provided and it contains enough information to use the game quickly. \p When \b RxChess is started the chessboard ( currently a very \i simple ascii-graphical one ) is displayed, followed by the menu. \br \br What the game is now, and what it will become over the near future, are vastly different things. The smart-board, from it's inception, has always been two player. Expect to be able to customize boards and pieces. Expect PGN ( portable game notation ). Expect AI. Expect internet and possibly, chat play. \br For now, I'm learning how to do all of those things. In the near future I will be adding persitance. That will lead to UNDO-ing moves and making the game virtually crash proof. A more developed ascii board display, including a listing of recent moves, a smaller board showing the last move made and a new "underLetters" menu system. More about that later. \br \t How To Use Starting the game: \br Place the RxChess.forth file in your RetroForth directory. On the command line enter: \pre \n rf-"port" -f dir\path\RxChess.forth \-pre Or in a running RetroForth enter: \pre \n load dir\path\RxChess.forth \f \-pre \br \br There are several game commands, and you can get help for them from typing the words 'help' or 'menu' followed by the command name. \pre \n chess open the chess game vocabulary \n play starts the game \n new resets the board to first positions \n cb clears the board to set one up using mv \n mv moves a list of 0 or more pieces \n oo castle Kingside. \n ooo castle Queenside. \n menu get chess help. \n help get chess help. \-pre \br chess opens the chess game vocabulary and makes the commands available to the user interface. \br play starts the board. On the first execution of play, the board will self test so to start a new game... \br new will place the pieces in the first positions. \br cb will clear the board. \br mv does just about everything. It takes a list of 0 or more moves on the data stack and executes them in the board. A move is defined as a base 18 number constructed like: \pre \n e2e4 \-pre \br Read THE BIG IDEA below for more about mv. \br \br \b oo and \b ooo are the castle commands. Depending on whose move it is each of these carries out the proper castling move. They don't currently test if this is a legal move. \br \t Development The development of the \b RxChess game is on going. You are invited to participate. Instructions on how to do so will be here very soon. \br \t NOTE \p It is not guarenteed to work with every version of RetroForth because it makes use of some of the most recent updates to the RetroForth language including but not limited to: prefixes, local name spaces, vectored functions, and aliasing words as well as defered execution. If these ideas are foriegn to you, don't worry, you will quickly see how they work. I didn't know when I started and look at me now. \t The \b BIG idea. Dad got a nicely carved chessboard from Mom one Fathers Day. He taught us all how to play. But Dad would take the game a bit further. A second board on the table, and a third and forth on the benches, to the side of each player, and hidden from the opponant, were used to "take the path not chosen". Games were recorded by a sibling, using something akin to SGN ( standard game notation), and one could go back and try out moves. This is how Dad set up the teaching environment to explain some of finer points of the game. \br \br Many years later, while teaching myself programming, I found some early web pages by Jeff Fox about colorForth. I found the entire colorForth idea facinating and endevored to learn enough to use the system. \br This meant that I would first need to learn Forth. \br In 1999 I found MVPforth, Gforth, Win32Forth, and "Starting Forth" by Leo Brodie. After becoming aquainted with these, I used what I learned from the MVPforth tutorial and "Starting Forth" to create a chess game called B18ChessBoard. MVP showed how to do ascii-graphical displays, and "Starting" showed how to do all the math required. \br \br B18ChessBoard is my first smart-board. A smart-board is being defined as one that: \pre \n Takes a consistant stream of game data and represents that data as the chess board positions. \-pre The idea behind the B18ChessBoard is that the File letters A through H, and the Rank numbers 1 through 8, can be used as a board co-ordinant language system if the number base of the Forth environment is changed to 18, to add the A through H as numbers. \br A move command is constructed to take base 18 numbers as representitive of the source and destination of the piece moving. \br \br During development of B18ChessBoard, the colorForth light came on for me and I wound up writting some very interesting Chess games. I'll provide some links and documentation about all that in the near future. \br One of those colorForth chess games inspired Charles Childers to code what has come to be known as \b RxChess " \i with-out version number". It is concidered the first in this line of chessgames written for the RetroForth that uses the Rx-core. That version takes moves that are constructed like: mv x1,y1 x2,y2 \br where x1 is the source row, y1 is the source column, x2 is the destination row and y2 is the destination column. Each of these can have a value between 0 and 7 where x is top to bottom 0-7 and y is left to right 0-7. This makes moves that look like: mv 7,3 5,3 \br which would be the king pawn move e2 to e4. \br \br \b RxChess0.0.1 changed the input language to base 18 numbers. It changed the \b mv move command to take base 18 numbers from the stack. It added En Passant, Pawn Promotion, and Castling commands, a help/menu system was added, and it displayed the board a little more square. \br \br \b RxChess0.0.2 is a further refinement. The commands from \b 0.0.1 are still available, but now \b mv does them all as well. The \b mv command can now take a list of either base 18 numbers or base 18 numbers paired with a 'char ( pronounced tic-character ). This 'char is any of the piece values. For white, one of ( P | N | B | R | Q | K ), and for black ( p | n | b | r | q | k ). A 'char requires that a base 18 move number be given first. For example: e2 'P mv \br would put a white pawn on the e2 square. \br To place an empty square use: e2 sq mv \br When a pawn moves two spaces, the space that he leaps over becomes the En Passant target square. If on the next move the opponant enters the En Passant target with an adjacent pawn, the pawn that moved into jeopardy will be removed from the board, automatically. \br Castleing commands \b oo and \b ooo are provided for convenience. They check whose move it is, calculate the king to move which triggers which rook to move. You can also execute a castle by moveing the king to his castle square. Moving the king two spaces executes a castle in that direction he is moving in, left or right, so be careful moving the Kings. \br \br Making \b mv do everything and do it on the stack in RetroForth using base 18 numbers and 'chars has a side benifit. One can easily create a human readable text file and have it "included" on the stack and executed using \b mv. Such a file can be used to preset a board. The file would start with the \b cb command. \b cb clears the board. Follow \b cb with your piece placements. Example: \pre \n cb a8 'R b8 'N c8 'B d8 'Q e8 'K f8 'B g8 'N h8 'R mv \-pre This would replace all of blacks pieces with white ones. To "include" such a file, create one in your favorite text editor and in the running game enter: \pre \n include "filename".txt \-pre If you have the words \b cb or \b oo or \b ooo or \b mv in the file, they will be executed. \br \end