Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PascalPons/connect4
/ functions
Functions
57 in github.com/PascalPons/connect4
⨍
Functions
57
◇
Types & classes
8
↓ 11 callers
Method
nbMoves
* @return number of moves played from the beginning of the game. */
Position.hpp:144
↓ 5 callers
Method
getSize
TranspositionTable.hpp:102
↓ 3 callers
Method
key3
* Build a symetric base 3 key. Two symetric positions will have the same key. * * This key is a base 3 representation of the sequence of played mo
Position.hpp:169
↓ 3 callers
Method
play
* Plays a possible move given by its bitmap representation * * @param move: a possible move given by its bitmap representation * only
Position.hpp:107
↓ 3 callers
Method
put
* Store a value for a given key * @param key: must be less than key_size bits. * @param value: must be less than value_size bits. null (0) value
TranspositionTable.hpp:135
↓ 2 callers
Method
canPlay
* Indicates whether a column is playable. * @param col: 0-based index of column to play * @return true if the column is playable, false if the c
Position.hpp:222
↓ 2 callers
Method
canWinNext
* return true if current player can win next move */
Position.hpp:136
↓ 2 callers
Method
get
OpeningBook.hpp:171
↓ 2 callers
Method
getKeySize
TranspositionTable.hpp:103
↓ 2 callers
Method
getKeys
TranspositionTable.hpp:100
↓ 2 callers
Method
getValueSize
TranspositionTable.hpp:104
↓ 2 callers
Method
getValues
TranspositionTable.hpp:101
↓ 2 callers
Method
isWinningMove
* Indicates whether the current player wins by playing a given column. * This function should never be called on a non-playable column. * @param
Position.hpp:242
↓ 2 callers
Function
med
* util functions to compute next prime at compile time */
TranspositionTable.hpp:30
↓ 2 callers
Method
playCol
* Plays a playable column. * This function should not be called on a non-playable column or a column making an alignment. * * @param col: 0-b
Position.hpp:232
↓ 1 callers
Method
add
* Add a move in the container with its score. * You cannot add more than Position::WIDTH moves */
MoveSorter.hpp:45
↓ 1 callers
Method
analyze
Solver.cpp:128
↓ 1 callers
Function
explore
* Explore and print all possible position under a given depth. * symetric positions are printed only once. */
generator.cpp:17
↓ 1 callers
Function
generate_opening_book
* Read scored positions from stdin and store them in an opening book * * Input lines must be a valid position (possibly empty string), a space and a
generator.cpp:43
↓ 1 callers
Method
getNext
* Get next move * @return next remaining move with max score and remove it from the container. * If no more move is available return 0 */
MoveSorter.hpp:57
↓ 1 callers
Function
has_factor
* tells if an integer n has a a divisor between min (inclusive) and max (exclusive) */
TranspositionTable.hpp:36
↓ 1 callers
Method
key
* @return a compact representation of a position on WIDTH*(HEIGHT+1) bits. */
Position.hpp:151
↓ 1 callers
Method
load
Empty opening book * Opening book file format: * - 1 byte: board width * - 1 byte: board height * - 1 byte: max stored position depth
OpeningBook.hpp:88
↓ 1 callers
Method
loadBook
Solver.hpp:71
↓ 1 callers
Function
log2
log2(1) = 0; log2(2) = 1; log2(3) = 1; log2(4) = 2; log2(8) = 3
TranspositionTable.hpp:49
↓ 1 callers
Method
moveScore
* Score a possible move. * * @param move, a possible move given in a bitmap format. * * The score we are using is the number of winning sp
Position.hpp:208
↓ 1 callers
Function
next_prime
return next prime number greater or equal to n. n must be >= 2
TranspositionTable.hpp:44
↓ 1 callers
Method
possibleNonLosingMoves
* Return a bitmap of all the possible next moves the do not lose in one turn. * A losing move is a move leaving the possibility for the opponent to
Position.hpp:187
↓ 1 callers
Method
save
OpeningBook.hpp:150
↓ 1 callers
Method
solve
Solver.cpp:107
Method
MoveSorter
* Build an empty container */
MoveSorter.hpp:74
Method
OpeningBook
OpeningBook.hpp:74
Method
Position
* Default constructor, build an empty position. */
Position.hpp:215
Method
Solver
Constructor
Solver.cpp:143
Method
TranspositionTable
TranspositionTable.hpp:111
Method
bottom_mask_col
return a bitmask containg a single 1 corresponding to the bottom cell of a given column
Position.hpp:344
Method
column_mask
return a bitmask 1 on all the cells of a given column
Position.hpp:350
Method
compute_winning_position
* @parmam position, a bitmap of the player to evaluate the winning pos * @param mask, a mask of the already played spots * * @return a bitmap
Position.hpp:300
Method
get
* Get the value of a key * @param key: must be less than key_size bits. * @return value_size bits value associated with the key if present, 0 ot
TranspositionTable.hpp:146
Method
getNodeCount
Solver.hpp:62
Method
index
TranspositionTable.hpp:106
Method
initTranspositionTable
OpeningBook.hpp:37
Function
main
* If used with a max depth parameter: generate all uniquepsoition upto max depth * If no parameter: read scoredposition from standard input to store
generator.cpp:81
Function
main
* Main function. * Reads Connect 4 positions, line by line, from standard input * and writes one line per position to standard output containing: *
main.cpp:35
Method
negamax
* Reccursively score connect 4 position using negamax variant of alpha-beta algorithm. * @param: position to evaluate, this function assumes nobody a
Solver.cpp:39
Method
opponent_winning_position
* Return a bitmask of the possible winning positions for the opponent */
Position.hpp:273
Method
partialKey3
* Compute a partial base 3 key for a given column */
Position.hpp:254
Method
popcount
* counts number of bit set to one in a 64bits integer */
Position.hpp:288
Method
possible
* Bitmap of the next possible valid moves for the current player * Including losing moves. */
Position.hpp:281
Method
reset
* reset (empty) the container */
MoveSorter.hpp:67
Method
reset
* Empty the Transition Table. */
TranspositionTable.hpp:125
Method
reset
Solver.hpp:66
Method
top_mask_col
return a bitmask containg a single 1 corresponding to the top cel of a given column
Position.hpp:339
Method
winning_position
* Return a bitmask of the possible winning positions for the current player */
Position.hpp:266
Method
~OpeningBook
OpeningBook.hpp:176
Method
~TableGetter
TranspositionTable.hpp:67
Method
~TranspositionTable
TranspositionTable.hpp:117