struct

Experion::Position

Inherits Experion::Moves < Struct < Value < Object

Constructors

new(fen : String)
Source
startpos
Source

Instance methods

attacked_by?(sq : Int, by : Int, occ : UInt64) : Bool

Is sq attacked by any piece of color by given occupancy occ?

Source
attackers_to(sq : Int, occ : UInt64, by : Int) : UInt64

Bitboard of all pieces of color by attacking sq given occupancy occ.

Source
castling
Source
fullmove
Source
generate(out_ptr : Pointer(UInt16)) : Int32
Source
generate_captures(out_ptr : Pointer(UInt16)) : Int32
Source
halfmove
Source
hash

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.

Source
hash_after(m : UInt16) : UInt64

Zobrist key of self after m, without copying the position. Used to probe the child's TT slot for move ordering.

Source
in_check?(color : Int = @stm) : Bool
Source
king_sq(color : Int) : Int32
Source
make_move(m : UInt16, upd_hash : Bool = true) : Nil

Mutates self. Callers must copy first: child = parent; child.make_move(m).

Source
make_null_move(upd_hash : Bool = true) : Nil

Null move (for search): pass the turn, clear ep.

Source
occ_all
Source
occ_of(color : Int) : UInt64
Source
phase
Source
piece_at(sq : Int) : UInt8
Source
pieces(pc : Int) : UInt64
Source
pieces_of(color : Int, ptype : Int) : UInt64
Source
pretty
Source
to_fen
Source

Macros

define_gen(fname, caps_only)
Source
emit(mv)

emits one move + bump count

Source
emit_promos(from_sq, to_sq)

emits all four promotions from -> to

Source