User-facing constructor. Defaults to the standard starting position.
Usage
gm_position(fen = NULL, call = rlang::caller_env())See also
Other core:
gm_game,
gm_legal_moves(),
gm_move(),
gm_status(),
is_gm_game(),
is_gm_position()
Examples
gm_position()
#> <gm_position> — White to move
#> 8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
#> 7 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
#> 6 · · · · · · · ·
#> 5 · · · · · · · ·
#> 4 · · · · · · · ·
#> 3 · · · · · · · ·
#> 2 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
#> 1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
#> a b c d e f g h
#> FEN: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
# Any legal position can be supplied as 'FEN'
gm_position("8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1")
#> <gm_position> — White to move
#> 8 · · · · · · · ·
#> 7 · · ♟ · · · · ·
#> 6 · · · ♟ · · · ·
#> 5 ♔ ♙ · · · · · ♜
#> 4 · ♖ · · · ♟ · ♚
#> 3 · · · · · · · ·
#> 2 · · · · ♙ · ♙ ·
#> 1 · · · · · · · ·
#> a b c d e f g h
#> FEN: "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1"