struct Chess::Position
- Chess::Position
- Struct
- Value
- Object
Defined in:
chess/position.crConstant Summary
-
BLACK_KING_SIDE_CASTLE_FLAG =
1_u8 << 2
-
BLACK_QUEEN_SIDE_CASTLE_FLAG =
1_u8 << 3
-
EP_SQUARE_DIRECTION =
[8, -8]
-
INITIAL =
new(INITIAL_POSITION_IN_FEN)
-
INITIAL_POSITION_IN_FEN =
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
-
KING_CASTLE_FLAGS =
[BLACK_QUEEN_SIDE_CASTLE_FLAG | BLACK_KING_SIDE_CASTLE_FLAG, WHITE_QUEEN_SIDE_CASTLE_FLAG | WHITE_KING_SIDE_CASTLE_FLAG]
-
PIECE_CHARS =
"pnbrqk."
-
ROOK_CASTLE_FLAGS =
Array(UInt8).new(64) do |idx| case idx when Square::A1.value WHITE_QUEEN_SIDE_CASTLE_FLAG when Square::H1.value WHITE_KING_SIDE_CASTLE_FLAG when Square::A8.value BLACK_QUEEN_SIDE_CASTLE_FLAG when Square::H8.value BLACK_KING_SIDE_CASTLE_FLAG else 0_u8 end end
-
WHITE_KING_SIDE_CASTLE_FLAG =
1_u8
-
WHITE_QUEEN_SIDE_CASTLE_FLAG =
1_u8 << 1
Constructors
Instance Method Summary
- #bishops
- #blacks
- #colours : Array(UInt64)
- #colours=(colours : Array(UInt64))
- #ep_square : Chess::Square
- #ep_square=(ep_square : Chess::Square)
- #fifty_move : Int32
- #fifty_move=(fifty_move : Int32)
- #flags : UInt8
- #flags=(flags : UInt8)
- #generate_moves
- #generate_pseudolegal_moves
- #generate_wrapped_moves
- #insufficient_material?
- #is_in_check?
- #is_square_attacked?(square, colour)
- #key : UInt64
- #key=(key : UInt64)
- #kings
- #knights
- #last_move : Int32
- #last_move=(last_move : Int32)
- #make_legal_move(move : MoveWrapper)
-
#make_legal_move(move : Int32) : Position
Same as make_move but without legality check
- #make_move(move : MoveWrapper)
- #make_move(move : Int32) : Position | Nil
- #move_count : Int32
- #move_count=(move_count : Int32)
- #pawn_key : UInt64
- #pawn_key=(pawn_key : UInt64)
- #pawns
- #pieces : Array(UInt64)
- #pieces=(pieces : Array(UInt64))
- #pretty
- #queens
- #rooks
- #side_to_move : Chess::Colour
- #side_to_move=(side_to_move : Chess::Colour)
- #to_fen
- #type_on_square(idx)
- #whites
Constructor Detail
Instance Method Detail
Same as make_move but without legality check