var searchIndex = {}; searchIndex["chess"] = {"doc":"","items":[[0,"color","chess","",null,null],[4,"Color","chess::color","Represent a color.",null,null],[13,"White","","",0,null],[13,"Black","","",0,null],[17,"NUM_COLORS","","How many colors are there?",null,null],[17,"ALL_COLORS","","List all colors",null,null],[11,"clone","","",0,null],[11,"eq","","",0,null],[11,"partial_cmp","","",0,null],[11,"to_index","","Convert the `Color` to a `usize` for table lookups.",0,null],[11,"to_my_backrank","","Covert the `Color` to a rank, which reperesnts the starting position\nfor that colors pieces.",0,null],[11,"to_their_backrank","","Convert a `Color` to my opponents backrank, which represents the starting position for the\nopponents pieces.",0,null],[11,"to_second_rank","","Convert a `Color` to my second rank, which represents the starting position for my pawns.",0,null],[11,"not","","Get the other color.",0,null],[0,"piece","chess","",null,null],[4,"Piece","chess::piece","Represent a chess piece as a very simple enum",null,null],[13,"Pawn","","",1,null],[13,"Knight","","",1,null],[13,"Bishop","","",1,null],[13,"Rook","","",1,null],[13,"Queen","","",1,null],[13,"King","","",1,null],[17,"NUM_PIECES","","How many piece types are there?",null,null],[17,"ALL_PIECES","","An array representing each piece type, in order of ascending value.",null,null],[11,"clone","","",1,null],[11,"partial_cmp","","",1,null],[11,"eq","","",1,null],[11,"to_index","","Convert the `Piece` to a `usize` for table lookups.",1,null],[0,"square","chess","",null,null],[3,"Square","chess::square","Represent a square on the chess board",null,null],[3,"ALL_SQUARES","","A list of every square on the chessboard.",null,null],[17,"NUM_SQUARES","","How many squares are there?",null,null],[11,"clone","","",2,null],[11,"partial_cmp","","",2,null],[11,"lt","","",2,null],[11,"le","","",2,null],[11,"gt","","",2,null],[11,"ge","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"new","","Create a new square, given an index.\nNote: It is invalid, but allowed, to pass in a number >= 64. Doing so will crash stuff.",2,{"inputs":[{"name":"u8"}],"output":{"name":"square"}}],[11,"make_square","","Make a square given a rank and a file",2,{"inputs":[{"name":"rank"},{"name":"file"}],"output":{"name":"square"}}],[11,"up","","If there is a square above me, return that. Otherwise, None.",2,null],[11,"forward","","If there is a square "forward", given my `Color`, go in that direction. Otherwise, None.",2,null],[11,"backward","","If there is a square "backward" given my `Color`, go in that direction. Otherwise, None.",2,null],[11,"down","","If there is a square below me, return that. Otherwise, None.",2,null],[11,"left","","If there is a square to the left of me, return that. Otherwise, None.",2,null],[11,"right","","If there is a square to the right of me, return that. Otherwise, None.",2,null],[11,"uup","","If there is a square above me, return that. Otherwise, return invalid data to crash the\nprogram.",2,null],[11,"udown","","If there is a square below me, return that. Otherwise, return invalid data to crash the\nprogram.",2,null],[11,"uleft","","If there is a square to the left of me, return that. Otherwise, return invalid data to\ncrash the program.",2,null],[11,"uright","","If there is a square to the right of me, return that. Otherwise, return invalid data to\ncrash the program.",2,null],[11,"uforward","","If there is a square "forward", given my color, return that. Otherwise, return invalid\ndata to crash the program.",2,null],[11,"ubackward","","If there is a square "backward", given my color, return that. Otherwise, return invalid\ndata to crash the program.",2,null],[11,"rank","","Return the rank given this square.",2,null],[11,"file","","Return the file given this square.",2,null],[11,"to_int","","Convert this square to an integer.",2,null],[11,"to_index","","Convert this `Square` to a `usize` for table lookup purposes",2,null],[11,"from_string","","Convert a UCI `String` to a square. If invalid, return `None`",2,{"inputs":[{"name":"string"}],"output":{"name":"option"}}],[11,"deref","","",3,null],[0,"chess_move","chess","",null,null],[3,"ChessMove","chess::chess_move","Represent a ChessMove in memory",null,null],[11,"eq","","",4,null],[11,"ne","","",4,null],[11,"partial_cmp","","",4,null],[11,"lt","","",4,null],[11,"le","","",4,null],[11,"gt","","",4,null],[11,"ge","","",4,null],[11,"clone","","",4,null],[11,"new","","Create a new chess move, given a source `Square`, a destination `Square, and an optional\npromotion `Piece`",4,{"inputs":[{"name":"square"},{"name":"square"},{"name":"option"}],"output":{"name":"chessmove"}}],[11,"get_source","","Get the source square (square the piece is currently on).",4,null],[11,"get_dest","","Get the destination square (square the piece is going to).",4,null],[11,"get_promotion","","Get the promotion piece (maybe).",4,null],[0,"bitboard","chess","",null,null],[3,"BitBoard","chess::bitboard","A good old-fashioned bitboard\nYou do *not* have access to the actual value. You *do* have access to operators",null,null],[17,"EMPTY","","An empty bitboard",null,null],[11,"clone","","",5,null],[11,"partial_cmp","","",5,null],[11,"lt","","",5,null],[11,"le","","",5,null],[11,"gt","","",5,null],[11,"ge","","",5,null],[11,"eq","","",5,null],[11,"ne","","",5,null],[11,"bitand","","",5,null],[11,"bitor","","",5,null],[11,"bitxor","","",5,null],[11,"bitand_assign","","",5,null],[11,"bitor_assign","","",5,null],[11,"bitxor_assign","","",5,null],[11,"mul","","",5,null],[11,"not","","",5,null],[11,"fmt","","",5,null],[11,"new","","Construct a new bitboard from a u64",5,{"inputs":[{"name":"u64"}],"output":{"name":"bitboard"}}],[11,"set","","Construct a new BitBoard with a particular 'Square' set",5,{"inputs":[{"name":"rank"},{"name":"file"}],"output":{"name":"bitboard"}}],[11,"from_square","","Convert a `Square` to a BitBoard",5,{"inputs":[{"name":"square"}],"output":{"name":"bitboard"}}],[11,"from_maybe_square","","Convert an `Option<Square>` to an `Option<BitBoard>`",5,{"inputs":[{"name":"option"}],"output":{"name":"option"}}],[11,"to_square","","Convert a `BitBoard` to a `Square`. This grabs the least-significant `Square`",5,null],[11,"popcnt","","Count the number of `Squares` set in this `BitBoard`",5,null],[11,"reverse_colors","","Reverse this `BitBoard`. Look at it from the opponents perspective.",5,null],[11,"to_size","","Convert this `BitBoard` to a `usize` (for table lookups)",5,null],[11,"get_rank","","Get a `BitBoard` that represents all the squares on a particular rank.",5,{"inputs":[{"name":"rank"}],"output":{"name":"bitboard"}}],[11,"get_file","","Get a `BitBoard` that represents all the squares on a particular file.",5,{"inputs":[{"name":"file"}],"output":{"name":"bitboard"}}],[11,"get_adjacent_files","","Get a `BitBoard` that represents the squares on the 1 or 2 files next to this file.",5,{"inputs":[{"name":"file"}],"output":{"name":"bitboard"}}],[11,"construct","","Perform initialization. Must be called before some functions can be used.",5,{"inputs":[],"output":null}],[11,"next","","",5,null],[0,"castle_rights","chess","",null,null],[4,"CastleRights","chess::castle_rights","What castle rights does a particular player have?",null,null],[13,"NoRights","","",6,null],[13,"KingSide","","",6,null],[13,"QueenSide","","",6,null],[13,"Both","","",6,null],[17,"NUM_CASTLE_RIGHTS","","",null,null],[17,"ALL_CASTLE_RIGHTS","","",null,null],[11,"partial_cmp","","",6,null],[11,"eq","","",6,null],[11,"clone","","",6,null],[11,"has_kingside","","Can I castle kingside?",6,null],[11,"has_queenside","","Can I castle queenside?",6,null],[11,"kingside_squares","","What squares need to be empty to castle kingside?",6,null],[11,"queenside_squares","","What squares need to be empty to castle queenside?",6,null],[11,"remove","","Remove castle rights, and return a new `CastleRights`.",6,null],[11,"add","","Add some castle rights, and return a new `CastleRights`.",6,null],[11,"to_index","","Convert `CastleRights` to `usize` for table lookups",6,null],[11,"from_index","","Convert `usize` to `CastleRights`. Panic if invalid number.",6,{"inputs":[{"name":"usize"}],"output":{"name":"castlerights"}}],[11,"unmoved_rooks","","Which rooks can we "guarantee" we haven't moved yet?",6,null],[11,"rook_square_to_castle_rights","","Given a square of a rook, which side is it on?\nNote: It is invalid to pass in a non-rook square. The code may panic.",6,{"inputs":[{"name":"square"}],"output":{"name":"castlerights"}}],[0,"board","chess","",null,null],[3,"Board","chess::board","A representation of a chess board. That's why you're here, right?",null,null],[4,"BoardStatus","","What is the status of this game?",null,null],[13,"Ongoing","","",7,null],[13,"Stalemate","","",7,null],[13,"Checkmate","","",7,null],[11,"clone","","",8,null],[11,"partial_cmp","","",7,null],[11,"eq","","",7,null],[11,"clone","","",7,null],[11,"new","","Construct a new `Board` that is completely empty.\nNote: This does NOT give you the initial position. Just a blank slate.",8,{"inputs":[],"output":{"name":"board"}}],[11,"from_fen","","Construct a board from a FEN string.",8,{"inputs":[{"name":"string"}],"output":{"name":"option"}}],[11,"status","","Is this game Ongoing, is it Stalemate, or is it Checkmate?",8,null],[11,"combined","","Grab the "combined" `BitBoard`. This is a `BitBoard` with every piece",8,null],[11,"color_combined","","Grab the "color combined" `BitBoard`. This is a `BitBoard` with every piece of a particular\ncolor.",8,null],[11,"king_square","","",8,null],[11,"pieces","","Grab the "pieces" `BitBoard`. This is a `BitBoard` with every piece of a particular type.",8,null],[11,"castle_rights","","Grab the `CastleRights` for a particular side.",8,null],[11,"add_castle_rights","","Add castle rights for a particular side.",8,null],[11,"remove_castle_rights","","Remove castle rights for a particular side.",8,null],[11,"side_to_move","","Who's turn is it?",8,null],[11,"my_castle_rights","","Grab my `CastleRights`.",8,null],[11,"add_my_castle_rights","","Add to my `CastleRights`.",8,null],[11,"remove_my_castle_rights","","Remove some of my `CastleRights`.",8,null],[11,"their_castle_rights","","My opponents `CastleRights`.",8,null],[11,"add_their_castle_rights","","Ad to my opponents `CastleRights`",8,null],[11,"set_piece","","For a chess UI: set a piece on a particular square",8,null],[11,"clear_square","","For a chess UI: clear a particular square",8,null],[11,"null_move","","Switch the color of the player without actually making a move",8,null],[11,"is_sane","","Does this board "make sense"?\nDo all the pieces make sense, do the bitboards combine correctly, etc?\nThis is for sanity checking.",8,null],[11,"get_hash","","",8,null],[11,"get_pawn_hash","","",8,null],[11,"piece_on","","What piece is on a particular `Square`? Is there even one?",8,null],[11,"enumerate_moves","","Give me all the legal moves for this board.",8,null],[11,"legal","","Is a particular move legal?",8,null],[11,"make_move","","Make a chess move",8,null],[11,"perft","","Run a perft-test.",8,null],[11,"perft_brute_force","","Run a perft-test using brute force move generation",8,null],[11,"perft_cache","","Run a perft test with a cache table",8,null],[11,"perft_test","","",8,{"inputs":[{"name":"string"},{"name":"u64"},{"name":"u64"}],"output":null}],[11,"fmt","","",8,null],[0,"magic","chess","",null,null],[3,"Magic","chess::magic","",null,null],[11,"clone","","",9,null],[11,"construct","","Initialize all the magic numbers and lookup tables.\nNote: You want to call construct::construct() instead. It's easier, and you must call\nBitBoard::construct() before calling this, so just rely on the other one.",9,{"inputs":[],"output":null}],[11,"get_bishop_rays","","Get the rays for a bishop on a particular square.",9,{"inputs":[{"name":"square"}],"output":{"name":"bitboard"}}],[11,"get_rook_rays","","Get the rays for a rook on a particular square.",9,{"inputs":[{"name":"square"}],"output":{"name":"bitboard"}}],[11,"get_rook_moves","","Get the moves for a rook on a particular square, given blockers blocking my movement.",9,{"inputs":[{"name":"square"},{"name":"bitboard"}],"output":{"name":"bitboard"}}],[11,"get_bishop_moves","","Get the moves for a bishop on a particular square, given blockers blocking my movement.",9,{"inputs":[{"name":"square"},{"name":"bitboard"}],"output":{"name":"bitboard"}}],[11,"get_king_moves","","Get the king moves for a particular square.",9,{"inputs":[{"name":"square"}],"output":{"name":"bitboard"}}],[11,"get_knight_moves","","Get the knight moves for a particular square.",9,{"inputs":[{"name":"square"}],"output":{"name":"bitboard"}}],[11,"get_pawn_attacks","","Get the pawn capture move for a particular square, given the pawn's color and the potential\nvictims",9,{"inputs":[{"name":"square"},{"name":"color"},{"name":"bitboard"}],"output":{"name":"bitboard"}}],[11,"get_pawn_quiets","","Get the quiet pawn moves (non-captures) for a particular square, given the pawn's color and\nthe potential blocking pieces.",9,{"inputs":[{"name":"square"},{"name":"color"},{"name":"bitboard"}],"output":{"name":"bitboard"}}],[11,"get_pawn_moves","","Get all the pawn moves for a particular square, given the pawn's color and the potential\nblocking pieces and victims.",9,{"inputs":[{"name":"square"},{"name":"color"},{"name":"bitboard"}],"output":{"name":"bitboard"}}],[11,"line","","Get a line (extending to infinity, which in chess is 8 squares), given two squares.\nThis line does extend past the squares.",9,{"inputs":[{"name":"square"},{"name":"square"}],"output":{"name":"bitboard"}}],[11,"between","","Get a line between these two squares, not including the squares themselves.",9,{"inputs":[{"name":"square"},{"name":"square"}],"output":{"name":"bitboard"}}],[0,"construct","chess","",null,null],[5,"construct","chess::construct","Call before using any objects within this library.\nMust be called at least once.\nCan be called more than once, and is thread safe.",null,{"inputs":[],"output":null}],[0,"rank","chess","",null,null],[4,"Rank","chess::rank","",null,null],[13,"First","","",10,null],[13,"Second","","",10,null],[13,"Third","","",10,null],[13,"Fourth","","",10,null],[13,"Fifth","","",10,null],[13,"Sixth","","",10,null],[13,"Seventh","","",10,null],[13,"Eighth","","",10,null],[17,"NUM_RANKS","","",null,null],[17,"ALL_RANKS","","",null,null],[11,"partial_cmp","","",10,null],[11,"eq","","",10,null],[11,"clone","","",10,null],[11,"from_index","","",10,{"inputs":[{"name":"usize"}],"output":{"name":"rank"}}],[11,"down","","",10,null],[11,"up","","",10,null],[11,"to_index","","",10,null],[0,"file","chess","",null,null],[4,"File","chess::file","",null,null],[13,"A","","",11,null],[13,"B","","",11,null],[13,"C","","",11,null],[13,"D","","",11,null],[13,"E","","",11,null],[13,"F","","",11,null],[13,"G","","",11,null],[13,"H","","",11,null],[17,"NUM_FILES","","",null,null],[17,"ALL_FILES","","",null,null],[11,"partial_cmp","","",11,null],[11,"eq","","",11,null],[11,"clone","","",11,null],[11,"from_index","","",11,{"inputs":[{"name":"usize"}],"output":{"name":"file"}}],[11,"left","","",11,null],[11,"right","","",11,null],[11,"to_index","","",11,null],[0,"zobrist","chess","",null,null],[3,"Zobrist","chess::zobrist","Create a completely blank type. This allows all the functions to be part of this type, which I\nthink is a bit cleaner than bare functions everywhere.",null,null],[11,"construct","","Initialized zobrist numbers for incremental update hashing. Must be called before hashes can be\nused for board objects.",12,{"inputs":[],"output":null}],[11,"piece","","Get the value for a particular piece",12,{"inputs":[{"name":"piece"},{"name":"square"},{"name":"color"}],"output":{"name":"u64"}}],[11,"castles","","",12,{"inputs":[{"name":"castlerights"},{"name":"color"}],"output":{"name":"u64"}}],[11,"en_passant","","",12,{"inputs":[{"name":"file"},{"name":"color"}],"output":{"name":"u64"}}],[11,"color","","",12,{"inputs":[],"output":{"name":"u64"}}],[0,"cache_table","chess","",null,null],[3,"CacheTable","chess::cache_table","Store a cache of entries, each with an associated hash.",null,null],[11,"new","","Create a new `CacheTable` with each associated entry initialized with a hash of '0'\nNote: Y ou must pass in a size where only 1 bit is set. (AKA: 2, 4, 8, 16, 1024, 65536,\netc.)\nPanics when size is invalid.",13,{"inputs":[{"name":"usize"},{"name":"t"}],"output":{"name":"cachetable"}}],[11,"get","","Get a particular entry with the hash specified",13,null],[11,"add","","Add (or overwrite) an entry with the associated hash",13,null]],"paths":[[4,"Color"],[4,"Piece"],[3,"Square"],[3,"ALL_SQUARES"],[3,"ChessMove"],[3,"BitBoard"],[4,"CastleRights"],[4,"BoardStatus"],[3,"Board"],[3,"Magic"],[4,"Rank"],[4,"File"],[3,"Zobrist"],[3,"CacheTable"]]}; initSearch(searchIndex);