Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/datumbox/Game-2048-AI-Solver
/ functions
Functions
35 in github.com/datumbox/Game-2048-AI-Solver
⨍
Functions
35
◇
Types & classes
6
↓ 10 callers
Method
getBoardArray
Getter for BoardArray @return
src/com/datumbox/opensource/game/Board.java:104
↓ 7 callers
Method
move
Performs one move (up, down, left or right). @param direction @return
src/com/datumbox/opensource/game/Board.java:123
↓ 6 callers
Method
action
Performs an Up, Right, Down or Left move @param direction @return @throws java.lang.CloneNotSupportedException
src/com/datumbox/opensource/game/Board.java:280
↓ 6 callers
Method
clone
Deep clone @return @throws CloneNotSupportedException
src/com/datumbox/opensource/game/Board.java:84
↓ 5 callers
Method
getScore
Getter for score attribute @return
src/com/datumbox/opensource/game/Board.java:96
↓ 4 callers
Method
findBestMove
Method that finds the best next move. @param theBoard @param depth @return @throws CloneNotSupportedException
src/com/datumbox/opensource/ai/AIsolver.java:55
↓ 4 callers
Method
getEmptyCellIds
Returns the Ids of the empty cells. The cells are numbered by row. @return
src/com/datumbox/opensource/game/Board.java:196
↓ 4 callers
Method
isGameTerminated
Checks whether the game is terminated @return @throws java.lang.CloneNotSupportedException
src/com/datumbox/opensource/game/Board.java:249
↓ 4 callers
Method
rotateLeft
Rotates the board on the left
src/com/datumbox/opensource/game/Board.java:333
↓ 4 callers
Method
rotateRight
Rotates the board on the right
src/com/datumbox/opensource/game/Board.java:348
↓ 3 callers
Method
addRandomCell
Creates a new Random Cell
src/com/datumbox/opensource/game/Board.java:363
↓ 3 callers
Method
getNumberOfEmptyCells
Counts the number of empty cells @return
src/com/datumbox/opensource/game/Board.java:215
↓ 3 callers
Method
isEqual
Checks whether the two input boards are same. @param currBoardArray, newBoardArray @return
src/com/datumbox/opensource/game/Board.java:405
↓ 3 callers
Method
setEmptyCell
Sets the value to an empty cell. @param i @param j @param value
src/com/datumbox/opensource/game/Board.java:323
↓ 2 callers
Method
calculateClusteringScore
Calculates a heuristic variance-like score that measures how clustered the board is. @param boardArray @return
src/com/datumbox/opensource/ai/AIsolver.java:251
↓ 2 callers
Method
clone2dArray
Clones a 2D array @param original @return
src/com/datumbox/opensource/game/Board.java:389
↓ 2 callers
Method
hasWon
Checks if any of the cells in the board has value equal or larger than the target. @return
src/com/datumbox/opensource/game/Board.java:228
↓ 2 callers
Method
heuristicScore
Estimates a heuristic score by taking into account the real score, the number of empty cells and the clustering score of the board. @param actualScor
src/com/datumbox/opensource/ai/AIsolver.java:239
↓ 2 callers
Method
printBoard
Prints the Board @param boardArray @param score @param hint
src/com/datumbox/opensource/ConsoleGame.java:199
↓ 1 callers
Method
alphabeta
Finds the best move bay using the Alpha-Beta pruning algorithm. @param theBoard @param depth @param alpha @param beta @param player @return @throws C
src/com/datumbox/opensource/ai/AIsolver.java:148
↓ 1 callers
Method
calculateAccuracy
Estimates the accuracy of the AI solver by running multiple games. @throws CloneNotSupportedException
src/com/datumbox/opensource/ConsoleGame.java:95
↓ 1 callers
Method
getDescription
Getter for description. @return
src/com/datumbox/opensource/dataobjects/ActionStatus.java:80
↓ 1 callers
Method
help
Prints Help menu
src/com/datumbox/opensource/ConsoleGame.java:72
↓ 1 callers
Method
playGame
Method which allows playing the game. @throws CloneNotSupportedException
src/com/datumbox/opensource/ConsoleGame.java:130
↓ 1 callers
Method
printMenu
Prints main menu
src/com/datumbox/opensource/ConsoleGame.java:79
Method
ActionStatus
Constructor @param code @param description
src/com/datumbox/opensource/dataobjects/ActionStatus.java:61
Method
Board
Constructor without arguments. It initializes randomly the Board
src/com/datumbox/opensource/game/Board.java:69
Method
Direction
Constructor @param code @param description
src/com/datumbox/opensource/dataobjects/Direction.java:62
Method
getCode
Getter for code. @return
src/com/datumbox/opensource/dataobjects/Direction.java:72
Method
getCode
Getter for code. @return
src/com/datumbox/opensource/dataobjects/ActionStatus.java:71
Method
getDescription
Getter for description. @return
src/com/datumbox/opensource/dataobjects/Direction.java:81
Method
getRandomGenerator
Getter for RandomGenerator field @return
src/com/datumbox/opensource/game/Board.java:113
Method
main
Main function of the game. @param args @throws CloneNotSupportedException
src/com/datumbox/opensource/ConsoleGame.java:40
Method
minimax
Finds the best move by using the Minimax algorithm. @param theBoard @param depth @param player @return @throws CloneNotSupportedException
src/com/datumbox/opensource/ai/AIsolver.java:72
Method
toString
Overloads the toString and returns the description of the move. @return
src/com/datumbox/opensource/dataobjects/Direction.java:89