Chess X!
	Version 1.6

A Basic Language Chess Program for the TI-83 and the TI-83 Plus
The most popular chess game for those calculators in any language

Designed and Coded by Marshall D. Duer-Balkind
Web site: http://go.to/mddb
August 6, 2000

Contents:
1:: Introduction
2:: Features
3:: Files included in ChessX.zip
4:: How to play
5:: How to make advanced moves (i.e. en passant capturing, castling, etc...)
6:: Check and Checkmate
7:: Saving, loading, and deleting
8:: Ending the game
9:: Contacting Me
10: What's Next for Chess X
11: Acknowledgments and Dedication

1:: Introduction
	This is a fast and intuitive two player chess program.  It is 
written in Basic, so it can be run on both the TI-83 and the TI-83 
Plus. It is the  first of its kind to recognize check and checkmate, 
and to be fully compliant with the official F.I.D.E. rules of chess.

2:: Features of Chess X!

Features included in version 1.3:
- A fast and intuitive cursor-based moving system
- Displays the piece being moved and the move it makes (origin and 
  destination coordinates) in the bottom text box on the side.
- Recognizes Check and Checkmate (ALL possible moves are considered by this 
  algorithm)
- Has fast and accurate verification of all moves to see if they are legal: 
  FULL compliance with official F.I.D.E. rules of Chess
- Game ends when king is checkmated
- Check and Checkmate can be turned off for increased speed
- Tracks Turns, and displays the current turn in the middle text box
- Has En Passant Capturing
- Semi-Automatic Castling
- Special moves are explained in top text box
- Can save up to 3 games simultaneously to memory as lists
- Save files have custom names up to 10 characters long, 
  preserves these name even if their string is deleted.
- If game has already been saved, the game will automatically save to
  the same file again when save is chosen.
- Loads saved games in less than 10 seconds!
- A fully graphical board with lifelike pieces in their respective 
  colors with opposite color backgrounds.  (White pieces are at the 
  bottom of the screen, black are at the top.)

New to this version:
- Dramaticaly increased the speed of the piece drawing algoritim. 
  The game load times are now very short (10 seconds at max)
- Added a version of my List/Sting encryptor, LS Crypt, to preserve 
  filenames agaist acidental deletion.

3:: The Files that make up Chess X! 
	(total size is aproximitly 11,368 bytes)
- CHESSX: The core program, home to the game engine and the kitchen sink. (4062)
- XCFILES: This program contains the routines for saving, loading and
  deleting games.  (1607)
- XCDRAW: The piece moving engine is now housed here (525)
- XCVERIFY: This program contains the algorithms for verifying the 
  legality of moves. (2435)
- XCCHECK: This algorithm searches for all pieces threatening the king (1024)
- Lcxs: this list keeps track of which of the three save files are in 
  use (40)
- Lcxn: This list preserves sting names as a list
- Str9: This String contains the names of saved games.  If you delete 
  it, the game will crash.  (42)
- Pic7: This is a picture of the board with no pieces on it for loading 
  saved games (767)
- Pic8: This is a picture of the board with all the pieces in place for 
  a fast start to new games (767)

4:: How to play
If you do not know how to play chess, come to my web site: 
http://go.to/mddb.  A graphical version of this instruction manual 
is also available there.
	The rules of Chess X! are identical to those of chess, as Chess 
X! is chess.  However, moving pieces is done differently (obviously, 
you can't pick up a piece and move it with your hands).  The keys used 
in Chess X! are as follows:
[Arrows] = move cursor
[2nd] or [ENTER] = select piece or destination space
[CLEAR] = deselect piece
[DELETE] = save, exit, change checkmate options, or start over
[MODE] = pause
[GRAPH] = view help screen
	Upon starting a new game, the player who wishes to be white 
moves first (If continuing an old game, the game continues as left, as 
described in section 6).  The player chooses a piece to move and uses 
the arrow keys to move the cursor over the chosen piece and presses 
[2nd] or [ENTER], depending on their preference.  The middle text box 
displays the piece selected and its origin coordinates.  (If the piece 
chosen is not correct, the player may press [CLEAR] to deselect the 
piece.)  The player continues by moving the cursor to the desired 
destination square, and pressing [2nd] or [ENTER] again.  If the move 
is verified as legal, the piece moves, the coordinates of the piece's 
new location appear in the upper text box, and the calculator is handed 
to the other player for their turn.  The last move remains in the 
dialog box to help show the other player what their opponents move was.
	If the move is illegal, or the player selects the wrong color 
piece, the error messages "Illegal Move" or "Wrong Turn/Wrong color," 
respectively, are displayed, and the player must select a new piece to 
move.  After each turn, the cursor returns the starting square E4.

5:: How to make advanced moves
	Chess X! contains 3 kinds of advanced moves (moves that require
different selections than usual to work).

Semi-Automatic Castling:
	To castle, move the king two spaces to the right or the left. 
Neither the king nor the castle may have moved yet, and there must be
no pieces between them.  This can be done with either castle.  If all 
the conditions are met, the program will recognize this move as step 
one in castling, and automatically move the castle into a position on 
the other side of the king.  If you move the castle first, the program 
will not recognize that you are castling, and thus not allow you to do 
so.  Please remember that it is not legal to castle out of or through 
check.

En Passant Capturing:
	En passant capturing is a special kind of pawn attack.  If a pawn is 2
spaces away from the starting row of enemy pawns (i.e. a black pawn in
row 4 or a white pawn on row 5, and an enemy pawn moves two spaces
forward to land on an adjacent square, the pawn may capture said
enemy pawn by moving on a diagonal as if it has only moved one space
forward.  This must be done on the very next move, or in ceases to be 
an option.
  Example:
  Black pawn on square E4, White pawn moves from D2 to D4.  On the next
  move, black pawn moves to D3, taking white pawn in passing.

Promoting Pawns:
	If you move your pawn to the other side of the board, the program will 
give you the option of promoting that pawn to a queen, castle, knight, 
or bishop. Make your selection, and the pawn is replaced with the
chosen piece.

6:: Check and Checkmate
	When ever you make a move, the xccheck algorithm searches the 
board to make sure that you have not exposed your king to check, and if 
you have not, the move is drawn.  Then the algorithm searches 
for any pieces threatening the opposing king.  If there is a check, the 
program proceeds to search for checkmate.  All possible moves are examined.
If it is a checkmate, then the game ends. (see chapter 8)
	The reason I have not put this feature in previous versions is 
it was too slow.  It is still not very fast, but I believe that the 
advantages of this feature outweigh its disadvantages.  If you disagree 
with me on this, you can easily disable the feature using the options
menu, which can be accessed from either the start menu or the in-game 
menu.  There are three ways in which the xccheck algorithm can be 
disabled.  First is MATE OFF, which turns off checkmate but leaves check 
intact.  Secondly, there is HOUSE RULES, which both disables checkmate 
and the lesser known checking rule which states that a king may not castle
out of or though check.  And if speed is your only concern, you can turn 
both CHECK AND MATE OFF.  Checkmate can be enabled again in the same way 
you disabled it.  Please note that if checkmate is turned off, the game 
will end only if you manually quit or take the opponent's king.

7:: Saving, Loading, and Deleting Games
	There are three save files, named 1,2,& 3.  A saved game 
consists of 9 lists, the first 8 containing the matrix that shows the 
location of all pieces, the 9th containing information about which pieces 
have been taken, whose turn it is, and whether the king can castle.  
The lists are named with variants on XA1.  Each saved game takes up 
about 800 bytes.  Empty save files take up no space.
	To save a game, press [DEL] and choose either Save and Resume, 
 Save and Exit, or save As...  Then you choose which save file to save 
it in.  If that save file is full, you will be prompted whether to 
overwrite or choose a different file.  If the file is empty, you will
be asked to name the file.  (If the save file is full, you will be
prompted to overwrite first.)  Names may 10 or less characters long,
and are stored in String 9.
	Once you have saved a game once, choosing Save+resume or
Save+Exit will automatically save your game to the same file.  If you
wish to save it to a different file than the last save, choose Save As.
This will allow you to begin the saving process again as described
above.  Save As... returns you to the [DEL] menu once finished, while
save+resume and save+exit resume or exits the game when finished,
respectively. 
	To load a saved game, choose Load Game from the opening 
menu and choose a save file to load. All files are displayed, but
choose one with a name (choosing an empty file will not do anything.)
Once selected, the saved game is loaded.  This process takes anywhere 
from 15 to 45 seconds depending on the number of pieces still on the 
board.  Game play resumes with the player whose turn it was when the 
game was stopped.  Game play then resumes.  Please note:  Choosing
one of the first two save options while playing a loaded game will
save the game to the same file.
	To delete a game, choose that option from the main menu and 
choose the game to delete.  Please do not delete other peoples games!
Deleting an empty file does nothing.  You can also delete files upon
winning the game (see chapter 8).
	In order to preserve the filenames in the event that the string 
thy are stored in (Str9) is deleted or altered by acident, I have 
included a customized version of my List-String Converter, LS Crypt, 
in Chess X.  This program writes the sting to a list, lCXN, when 
Chess X is exited, and recovers it to Str9 when Chess X is run.  
When you see the "uncompressing..." message, this is what is going on.
I will atempt to speed this proccess up for future versions.

8:: Ending the Game
	The game ends when the a king is checkmated (or, if this is 
turned off, when a king is taken).  At this point, the
cursor disappears and a winner is declared.  Before exiting, you can 
save the screen to Pic4.  With this snapshot, you can savor your 
victory forever!  If you have saved your game, you will be prompted to
erase the file.  I recommend that you do so, as it frees up lots of
space for future games.  If you choose to do this, the file will be
cleared automatically.
	If your game ends in a draw, or you simply want to end it,
choose the exit or start over options on the main [Del] menu.  If you have
not saved, you will be prompted to save first.

9:: Contacting me
	If you have any questions, comments, suggestions, about 
Chess X!, please e-mail me at mdduerbalkind@hotmail.com

	The MDDB Programs web page has information on upcoming Chess X! 
releases, an expanded version of this instruction manual with 
screenshots, and other programs I have made.  
Find it at: http://go.to/mddb

	Because I believe in open source codes, this program is not 
protected, so feel free to look at my source code and e-mail me if you 
have questions.  But DO NOT use my code without asking me first and 
then crediting me, and DO NOT SELL THIS GAME.

10:: What's next for Chess X!

Version 2 (release: summer 2000)
- I'm going to rewrite the BASIC code from start to finish for 
  greater speed, efficiency and compactness.
- Two calculator play over the link cable.
AI in ASM (release: future)
- I may make an ASM version of Chess X! with AI for one player 
  games against your devious little calculator.  See 
  HTTP://go.to/mddb for news on this concept program.

11:: Acknowledgements and Dedication
	Special Thanks goes to Devin Symons and Ariel M'ndange-Pfupfu
whose knowledge of calculator BASIC and HTML was instrumental in 
creating this game and its web site.
	I would also like to thank Francis Huang, whose comments on 
previous versions were very helpful.

Chess X! is dedicated to my Great Uncle Gaby, who taught me not only 
to play Chess, also the most important thing about it--the love of 
the game.

Chess X! is copyrighted to Marshall Duer-Balkind, 1999-2000
