Entering+Moves

into the IBM 704 console, 1958 ||~ ||^ || toc =CLI= In a sequential command line interface the chess program prompts for input. Unless [|redirected], input is expected from the [|keyboard]. In CLI, [|text input] is usually [|buffered] and [|echoed] by the [|operating system] until the user confirms it by pressing the [|enter- or return key], causing the OS to transfer the whole text line via [|standard streams] to the program.
 * Home * User Interface * Entering Moves**
 * [[image:2-1.Bernstein-alex.1958.L02645391.IBM_ARCHIVES.lg.jpg width="231" height="285" link="http://www.computerhistory.org/chess/full_record.php?iid=stl-431614f6482e6"]] ||~  || **Entering Moves** is the [|user's] primary input while [|interacting] with the chess program during game play, to make a move. Chess engines using a command line interface may rely on external chess user interfaces or GUIs and their protocols without dealing with possible ambiguous and order dependent user interactions while entering moves, and receive moves in a defined notation via a [|standard input stream]. The Chess Engine Communication Protocol and the Universal Chess Interface both use simple to [|parse] pure algebraic coordinate notation . XBoard version 2 has the option to switch on SAN. Entering moves inside an [|event driven] GUI, more intuitive for the casual user not familiar with chess coordinates, requires more effort for the GUI programmer. ||
 * Alex Bernstein entering moves

The user has to type in his move according to the syntax or notation the program or GUI understands, most common pure algebraic coordinate notation as used in the Chess Engine Communication Protocol and the Universal Chess Interface, that is: code ::= [ ]        ::=     ::= 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'   ::= '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8' ::= 'q'|'r'|'b'|'n' code A from-to delimiter, a dash, hyphen or space for quiet moves or 'x' or colon for captures, is usually omitted and may only used in a notation window to make it easier to read for humans. Castles are given by king from-to coordinates ('e1g1', 'e1c1') or its own syntax of 'O-O' or 'O-O-O', also required for Chess960.

=GUI= Event driven graphical user interfaces allow more flexible interactions to enter moves. While this is more user friendly, it is more effort for the GUI programmer, due to the implementation of a [|finite state machine] for various states, modes and actions of a sequence of move entering interactions by a [|pointing device] and/or keyboard, considering possible different [|focus windows] like board window, notation window or a dedicated CLI-like command window or [|form], and also focus changes.

Drag-and-drop
The "natural" way to enter moves, similar to the interactions of a real chessboard, is [|drag-and-drop] with the pointing device, also emulated by the keyboard. The user first selects the piece on its departure square, grabs it by [|clicking] a device button, to drag it to the destination square, where the button is released to drop the piece. Another pointing device alternative without dragging is to select both squares in any order. A drag-and-drop or click-click keyboard simulation would require a square [|cursor], navigated by [|arrow keys] and/or entering square coordinates (file letter and rank number in any order), and for instance the space key to grab and drop the piece.

Assistants
Some GUIs support casual players by indicating all possible destination squares after selecting the piece, or the other way around, after first selecting a destination square, highlighting all pieces on the board which may move to that square.
 * [[image:v1.png link="@http://www.aartbik.com/MISC/android.html"]] ||
 * Aart Bik's Chess for Android, selecting f3 shows all queen targets highlighted ||

Advanced modes for ambitious Blitz players may already confirm the move entering interaction, if only one piece can move to a selected destination square, or if a selected piece has only one move. Similar is possible for moves that seem plausible according to some move entering heuristics, for instance //Heumas// (Heuristic Move Assistant - developed by Chrilly Donninger ), as used in ChessBase or Fritz GUI.

Promotions
Promotions require the additional interaction to chose a piece, which might be implemented via a [|menu] popping up on the promotion square, temporarily grabbing the keyboard focus - or similar, but slightly less comfortable, using a [|modal dialog] with a small [|list box] or four [|radio-buttons] and an [|OK button] to confirm, in all cases queening as default. Entering a piece letter should be appropriate as well to finish the sequence of move entering interactions.

Move List Interactions
If the notation window has the keyboard focus, pressing a none control key may activate a [|text box] to enter moves in various notations like pure algebraic coordinates, LAN or SAN. Further, a [|Content assist] or [|combo box] may list all possible moves, where the user may choose one.

=Dedicated Chess Computers= Dedicated Chess Computers have their own move entering systems, the board computers likely sensory boards with pressure-sensitive switches or piece recognition. Small chess computers often have a dedicated coordinate keyboard, eight keys to enter file and rank in context of from- and then to-square.
 * [[image:ElektorCC.jpg width="480" height="324" link="http://www.andreadrian.de/schach/#Selbstbau_Schachcomputer_SHAH"]] ||
 * [|Elektor] Chess Computer with Micro-Max inside ||

More minimalistic systems, like Harm Geert Muller's Matchbox Usurpator, even managed move input with only one switch and some mode feedback from the display.

=Computer Vision= Chess playing Robots may recognize the moves their (human) opponents made on an ordinary chess board in a more sophisticated way by [|computer vision] and [|real-time] video [|image processing].

=Parsing= While [|parsing] move notations, especially SAN, it is handy to have a list of legal moves available for the current position the engine is pondering on. Programs may tolerate redundant, overdetermined from-square specifications in SAN like given by LAN, including dash or hyphen. Leading piece letters are supposed to be upper case, while file letters and promoted piece letters should be lower case characters.

=See also=
 * Algebraic Chess Notation
 * Dedicated Chess Computers
 * Graphical User Interface
 * Protocols
 * Robots
 * Voice User Interface

=External Links=
 * [|Standard: Portable Game Notation Specification and Implementation Guide] by Steven Edwards
 * [|Input device from Wikipedia]
 * [|Human interface device]
 * [|Computer keyboard]
 * [|Mouse (computing)]
 * [|Touchscreen]

=References= =What links here?= include page="Entering Moves" component="backlinks" limit="40"
 * Up one Level**