summaryrefslogtreecommitdiffstats
path: root/share/man/man6/chess-mv.6
blob: ca8ee6dfe70a3c31fc7973e84647db1327629076 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.\" Copyright (c) 2022 by Alejandro Colomar <alx.manpages@gmail.com>
.\" SPDX-License-Identifier: GPL-2.0
.\"
.TH CHESS-MV 6 2022-01-23 chessutils "Games Manual"
.SH NAME
chess\-mv \- move a piece in a chess game
.SH SYNOPSIS
.B chess\-mv
.I move
.SH DESCRIPTION
.MR chess\-mv 6
reads a chessboard from standard input,
applies a (legal) move to it,
and then prints the updated chessboard to standard output.
.PP
.I move
is a chess move in Standard Algebraic Notation (SAN),
except for the following difference:
pieces are not always uppercase,
but uppercase or lowercase depending on the player that moves.
For example, a valid first move for the white (lowercase) player is
.IR pe2e4 ,
while a valid first move for the black (uppercase) player is
.IR Pe7e5 .
.SH EXIT STATUS
On success, the program exits with a status of
.BR EXIT_SUCCESS .
On error, one of the following values can be returned.
.SH ERRORS
.TP
.B EX_DATAERR
The chessboard read from standard input was invalid
(contained invalid characters, or wasn't 8x8).
.TP
.B EX_IOERR
A write to standard output failed.
.TP
.B EX_USAGE
The user passed an invalid number of arguments.
.TP
.B EX_USAGE
.I move
has a syntax error, and couldn't be parsed.
.TP
.B EX_USAGE
.I move
is ambiguous.
.TP
.B EXIT_FAILURE
.I move
is an illegal move.
.PP
(See
.MR sysexits.h 0 .)
.SH BUGS
Special notation for "en passant" isn't yet supported.
.SH EXAMPLES
.EX
$ chess\-init | chess\-mv pe2e3
RNBQKBNR
PPPPPPPP
\- \- \- \- 
 \- \- \- \-
\- \- \- \- 
 \- \-p\- \-
pppp\-ppp
rnbqkbnr
.EE
.SH COPYRIGHT
Copyright (c) 2022 by
.MT alx.manpages@gmail.com
Alejandro Colomar
.ME .
.PP
SPDX-License-Identifier:
.B GPL-2.0
.SH SEE ALSO
.MR chessboard\-empty 6 ,
.MR chess\-init 6 ,
.MR chess\-lsmv 6 ,
.MR chessutils 7