summaryrefslogtreecommitdiff
path: root/strategies
AgeCommit message (Collapse)Author
2022-01-21Remove blank lineRobby Zambito
2022-01-21Added a strategyRobby Zambito
Added strategy which will try to minimize the potential flips for the opponents next turn.
2022-01-21Made apply_move return the number of flipped spaces.Robby Zambito
This will return zero for invalid moves, and non-zero for valid moves. This means we can continue to use the result of this as a boolean. Also created a new Scheme primitive which returns the number of tiles flipped by a given move. Created two strategies. One which picks the move that flips the most tiles in the current turn, and one which flips the least.
2022-01-21Add a strategy which picks a valid move at randomRobby Zambito
2022-01-21Fleshed out Scheme primitivesRobby Zambito
* Moved board specific functions from othello.h to new othello_board.h * Removed unused function pointer for player moves * Added prototypes in headers for SCM functions, including scm_get_current_player, * Made get_winner accept a board and current player. This is useful for predictions to see if some move would make the other player a winner. * get_winner also writes the players scores to provided pointers.
2022-01-21Removed strategy that would only play a hard coded moveRobby Zambito
2022-01-21Removed useless fileRobby Zambito
2022-01-18Added a slightly more interesting AIguile-playerRobby Zambito
This AI will simply pick the first valid move it finds. This is pretty much the most basic AI that a full game can be played against.
2022-01-18* Made print_board accept a board to print.Robby Zambito
* free_board should not return anything. * is_valid_move and has_valid_moves accept a board. * Implemented primitives for Scheme strategies to get the current player, and to get the board, and the validity of a move. * Removed game logic from is_valid_move. Instead simply apply the move to a temp board, and see if the move worked. * Created a very simple strategy for testing these primitives. It only hardcodes the first move, and then fails since that move is no longer valid.