summaryrefslogtreecommitdiff
path: root/src/board.c
AgeCommit message (Collapse)Author
2022-01-21Expose print-board to allow Scheme to print the board normallyRobby Zambito
2022-01-21Add command line argument to print the final board as a scheme objectRobby Zambito
This could be useful to create a machine learning AI, which uses the final board for training. Also bubble up the final score and present it at the end of the game.
2022-01-21Consolidate redundant .c filesRobby Zambito
* Move print_board function to board.c * Move the move validation functions to move.c
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-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.
2022-01-05Added commentRobby Zambito
2022-01-05Make apply_move accept a board as a parameter.Robby Zambito
This was how it originally was, but I changed it to use a global variable instead. I want to be able to use the apply_move function in the is_valid_move implementation, to have all the logic for checking if a move is valid in one place. Moved the apply_move function out of board.c, since it no longer needs a direct reference to the board.
2021-12-30Pulled lots of things out of game loopRobby Zambito