Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GregoryCannon/StackRabbit
/ functions
Functions
215 in github.com/GregoryCannon/StackRabbit
⨍
Functions
215
◇
Types & classes
31
↓ 38 callers
Function
maybePrint
src/cpp_modules/src/utils.hpp:37
↓ 22 callers
Function
getTestBoardWithHeight
(height: number)
src/server/board_helper.ts:194
↓ 17 callers
Function
canDoPlacement
( board: Board, level: number, pieceId: string, rotationIndex: number, xOffset: number, inputFrame
src/server/move_search.ts:570
↓ 11 callers
Function
mainProcess
src/cpp_modules/src/main.cpp:37
↓ 11 callers
Function
pieceCollision
( board: Board, x: number, y: number, piece: PieceArray )
src/server/board_helper.ts:9
↓ 10 callers
Function
printBoard
src/cpp_modules/src/utils.hpp:57
↓ 9 callers
Function
collision
* Checks for collisions with the board and the edges of the screen */
src/cpp_modules/src/move_search.cpp:17
↓ 8 callers
Function
getPieceRangeContext
src/cpp_modules/src/piece_ranges.cpp:52
↓ 7 callers
Function
advanceGameState
Gets the game state after completing a given move */
src/cpp_modules/src/move_result.cpp:332
↓ 7 callers
Function
formatPlayout
src/cpp_modules/src/formatting.hpp:89
↓ 7 callers
Function
getPossibleMoves
( startingBoard: Board, currentPieceId: PieceId, level: number, existingXOffset: number, existingYOf
src/server/move_search.ts:49
↓ 7 callers
Function
isAnyOf
(str, possible)
src/server/precompute.ts:384
↓ 7 callers
Function
verifyNumMoves
(pieceId, expectedLength)
src/server/move_search_test.ts:12
↓ 6 callers
Function
GetGravity
(level)
src/server/utils.ts:37
↓ 6 callers
Function
getPlayoutScore
src/cpp_modules/src/playout.cpp:120
↓ 5 callers
Function
_modulus
(n: number, m: number)
src/server/board_helper.ts:189
↓ 5 callers
Function
_validateIntParam
(value: number, min: number, max: number)
src/server/board_helper.ts:98
↓ 5 callers
Function
generateInputFrameTimeline
(delaySequence: Array<number>)
src/server/utils.ts:166
↓ 5 callers
Function
getLineClearFactor
src/cpp_modules/src/eval.cpp:260
↓ 5 callers
Function
getStackRabbitArgString
(args)
src/wasm/wasmRabbit-worker.js:22
↓ 5 callers
Function
partiallySortPossibilityList
* Performs a partial insertion sort such that the highest N elements of the list are guaranteed to be sorted and kept at the front of the list. * The
src/cpp_modules/src/high_level_search.cpp:16
↓ 4 callers
Function
IsGravityDoubled
(level)
src/server/utils.ts:27
↓ 4 callers
Function
debugPrint
src/cpp_modules/src/utils.hpp:47
↓ 4 callers
Function
fastEval
src/cpp_modules/src/eval.cpp:428
↓ 4 callers
Function
formatPossibility
( possibility: PossibilityChain, shouldPushDown = false )
src/server/utils.ts:121
↓ 4 callers
Function
getCppEncodedInputString
( searchState: SearchState, urlArgs: UrlArguments )
src/server/request_parser.ts:233
↓ 4 callers
Function
getEvalContext
src/cpp_modules/src/eval_context.cpp:52
↓ 4 callers
Function
moveSearch
src/cpp_modules/src/move_search.cpp:428
↓ 4 callers
Function
placementIsLegal
( goalRotationIndex: number, goalOffsetX: number, simParams: SimParams, shouldLog: boolean = false,
src/server/move_search.ts:600
↓ 4 callers
Function
printBoardWithPiece
src/cpp_modules/src/utils.hpp:70
↓ 4 callers
Function
repeatedlyShiftPiece
* Helper function that shifts a hypothetical piece as many times as it can in * each direction, before it hits the stack or the edge of the screen.
src/server/move_search.ts:434
↓ 4 callers
Function
searchDepth2
Searches 2-ply from a starting state, and performs a fast eval on each of the resulting states. * @returns an UNSORTED list of evaluated possibiliti
src/cpp_modules/src/high_level_search.cpp:88
↓ 4 callers
Function
shouldPerformInputsThisFrame
* Given a string such as X.... that represents a loop of which frames are allowed for inputs, * determines if a given frame index is an input frame
src/cpp_modules/src/utils.hpp:193
↓ 4 callers
Function
shouldPerformInputsThisFrame
( inputFrameTimeline: string, frameNum: number )
src/server/utils.ts:153
↓ 3 callers
Function
debugLog
(simState: SimState, simParams: SimParams, reason: string)
src/server/dfs.ts:247
↓ 3 callers
Function
encodeLockPosition
Concatenates the position of a piece into a single string. * * NB: differs from formatLockPosition by the order of the values and the X coordinate
src/cpp_modules/src/formatting.hpp:15
↓ 3 callers
Function
exploreHorizontally
* Explores how far in a given direction a piece can be shifted, and registers all the legal placements along * the way */
src/cpp_modules/src/move_search.cpp:61
↓ 3 callers
Function
formatLockPosition
Formats a human-readable lock location */
src/cpp_modules/src/formatting.hpp:34
↓ 3 callers
Function
getBoardAndLinesClearedAfterPlacement
( board: Board, currentRotationPiece: PieceArray, x: number, y: number )
src/server/board_helper.ts:67
↓ 3 callers
Function
getPossibilityFromSimState
( simState: SimState, simParams: SimParams, inputSequence: string, inputCost: number )
src/server/move_search.ts:293
↓ 3 callers
Function
getSearchStateAfter
( prevSearchState: SearchState, possibility: Possibility )
src/server/move_search.ts:20
↓ 3 callers
Function
getSurfaceArray
src/cpp_modules/src/utils.hpp:144
↓ 3 callers
Function
getTopMoveList
* Gets a list of the top moves, formatted as a JSON string. (See formatting.hpp for exact format details). */
src/cpp_modules/src/high_level_search.cpp:319
↓ 3 callers
Function
getWeights
src/cpp_modules/src/params.hpp:143
↓ 3 callers
Function
insertIntoList
Performs the insertion operation from insertion sort. */
src/cpp_modules/src/utils.hpp:261
↓ 3 callers
Function
runCommand
(command, args, label)
install.js:3
↓ 3 callers
Function
searchDepth1
Searches 1-ply from a starting state, and performs an eval on each resulting state. * @returns an UNSORTED list of evaluated possibilities */
src/cpp_modules/src/high_level_search.cpp:60
↓ 3 callers
Function
searchForTucksOrSpinsInternal
( potentialTuckSpinStates: Array<DFSState>, simParams: SimParams, lockHeightLookup: Map<string, number>,
src/server/dfs.ts:99
↓ 3 callers
Function
updateSurfaceAndHoles
* Manually finds the surface heights and holes after lines have been cleared (since usual prediction tricks * don't apply). * @param excludeHolesCol
src/cpp_modules/src/move_result.cpp:209
↓ 2 callers
Method
_wrapAsync
(func)
src/server/request_handler.ts:121
↓ 2 callers
Function
analyzeHole
* Rates a hole from 0 to 1 based on how bad it is. * Ignore all but the most permissible of tuck setups while digging. * --Side effect-- marks the h
src/cpp_modules/src/move_result.cpp:10
↓ 2 callers
Function
computeYValueOfEachShift
* Calculates a lookup table for the Y value you'd be at while doing shift number N. * This is used in the tuck search, since this would be the first
src/cpp_modules/src/piece_ranges.cpp:33
↓ 2 callers
Function
copyBoard
src/cpp_modules/src/utils.hpp:138
↓ 2 callers
Function
countInputs
(placement)
src/server/precompute.ts:403
↓ 2 callers
Function
debugLog
(simState: SimState, simParams: SimParams, reason: string)
src/server/move_search.ts:800
↓ 2 callers
Function
encodeBoard
src/cpp_modules/src/utils.hpp:124
↓ 2 callers
Function
evalForPerfectPlay
Custom evaluation function designed for perfect play. The score it returns is aimed to emulate the percent chance of maintaining a perfect board throu
src/cpp_modules/src/eval.cpp:365
↓ 2 callers
Function
formatBoard
Formats a board using a simple proprietary compression/encoding system. * * Example compressed board: * 15,CaEa,3 * * - The first number is the
src/cpp_modules/src/formatting.hpp:59
↓ 2 callers
Function
formatPrecomputeResult
(results, defaultPlacement)
src/server/precompute.ts:356
↓ 2 callers
Function
getAverageHeight
src/cpp_modules/src/eval.cpp:80
↓ 2 callers
Function
getGravity
src/cpp_modules/src/utils.hpp:176
↓ 2 callers
Method
getMoveSync
* Synchronously choose the best placement, with no next box and no search. * @returns {string} the API response
src/server/request_handler.ts:143
↓ 2 callers
Function
getRandomPiece
(prevPieceIndex)
src/browser_test_site/index.js:50
↓ 2 callers
Method
handlePrecomputeRequest
* Pre-compute both an initial placement and all possible adjustments for the upcoming piece. * @returns {string} the API response
src/server/request_handler.ts:215
↓ 2 callers
Function
isGravityDoubled
src/cpp_modules/src/utils.hpp:185
↓ 2 callers
Function
lockLocationEquals
src/cpp_modules/src/utils.hpp:256
↓ 2 callers
Function
logBoard
(board)
src/server/utils.ts:278
↓ 2 callers
Function
moveSearchInternal
* Main move search implementation. * Wrapped in two parent functions depending on whether the move search is from standard spawn or from a midair adj
src/cpp_modules/src/move_search.cpp:350
↓ 2 callers
Function
parseBoard
(boardStr: string)
src/server/utils.ts:237
↓ 2 callers
Function
performSimulationRotation
( goalRotationIndex: number, simState: SimState, board: Board, rotationsList: Array<PieceArray> )
src/server/move_search.ts:752
↓ 2 callers
Function
performSimulationShift
( xIncrement: number, simState: SimState, board: Board, currentRotationPiece: PieceArray )
src/server/move_search.ts:723
↓ 2 callers
Function
pixelIsBlack
(frame, x, y)
src/console_client/video_capture.py:6
↓ 2 callers
Function
playOneMove
Plays one move from a given state, with or without knowledge of the next box.*/
src/cpp_modules/src/high_level_search.cpp:138
↓ 2 callers
Function
predictSearchStateAtAdjustmentTime
( initialState: SearchState, inputSequence: string, inputFrameTimeline: string )
src/server/precompute.ts:431
↓ 2 callers
Function
qualityRandom
src/cpp_modules/src/utils.hpp:294
↓ 2 callers
Function
sendFrames
(frames)
src/console_client/naive_agent.py:57
↓ 2 callers
Function
simulateGames
()
src/browser_test_site/index.js:123
↓ 2 callers
Function
sleep
(ms)
src/server/request_handler.ts:12
↓ 1 callers
Function
GetGravityPAL
(level)
src/server/utils.ts:73
↓ 1 callers
Method
_calculatePhantomPlacements
( initialSearchState: SearchState, possibleMoves: Array<Possibility>, inputFrameTimeline: string
src/server/precompute.ts:139
↓ 1 callers
Method
_compileResponseFinesse
()
src/server/precompute.ts:262
↓ 1 callers
Method
_precompileAdjustmentMoves
()
src/server/precompute.ts:220
↓ 1 callers
Function
adjustmentSearch
src/cpp_modules/src/move_search.cpp:436
↓ 1 callers
Function
cTest
()
src/server/cmodules.ts:3
↓ 1 callers
Function
calculateEntryDelayFrames
Calculate the ARE as a function of the "lock height" (the height of the highest cell in the piece)
src/server/move_search.ts:345
↓ 1 callers
Function
calculateFlatness
* A crude way to evaluate a surface for when I'm debugging and don't want to load the surfaces every time I * run. */
src/cpp_modules/src/eval.cpp:15
↓ 1 callers
Function
clearLines
Clear all filled lines on a board * @returns the number of lines cleared
src/server/board_helper.ts:48
↓ 1 callers
Function
debugLogResultBoard
(resultBoard)
src/console_client/naive_agent.py:190
↓ 1 callers
Function
executeInput
(inputChar)
src/console_client/raspberry_pi.py:47
↓ 1 callers
Function
exploreLegalPlacementsUntilLock
Starts with a set of states that are legal placements, but still have the piece hovering in the air. * Simulates letting them drop by gravity, and no
src/server/move_search.ts:170
↓ 1 callers
Function
explorePlacementsHorizontally
* Calculates how far in each direction a hypothetical piece can be tapped (for each rotation), given the AI's tap speed and * the piece's current pos
src/server/move_search.ts:362
↓ 1 callers
Function
explorePlacementsNearSpawn
* Explores for moves with more rotations than shifts (the only blind spot of the default exploration * behavior). */
src/cpp_modules/src/move_search.cpp:162
↓ 1 callers
Function
fetchPrecomputeResult
()
src/console_client/naive_agent.py:197
↓ 1 callers
Function
findPlayerMove
* Finds the move out of a list of possibilities that has the resulting board equal to the player's resulting board. * NB: REMOVES THE ELEMENT FROM TH
src/cpp_modules/src/high_level_search.cpp:193
↓ 1 callers
Function
findTuckInput
src/cpp_modules/src/move_search.cpp:236
↓ 1 callers
Function
findTucks
Searches for tucks by 1) Finding all of the overhang cells from the board array, then 2) looping over the overhang cells and trying all the ways th
src/cpp_modules/src/move_search.cpp:300
↓ 1 callers
Method
finessePrecompute
( searchState: SearchState, shouldLog: boolean, inputFrameTimeline: string, onPartialResultCal
src/server/precompute.ts:73
↓ 1 callers
Function
formatEngineMoveList
* Formats a list of engine moves, for use in the "engine-movelist-cpp" API request. * The format is JSON-like, as follows: * "[ * { * firstP
src/cpp_modules/src/formatting.hpp:136
↓ 1 callers
Function
formatRateMove
src/cpp_modules/src/formatting.hpp:182
↓ 1 callers
Function
generateInputSequence
( rotationIndex, xOffset, inputFrameTimeline, framesAlreadyElapsed = 0 )
src/server/board_helper.ts:122
next →
1–100 of 215, ranked by callers