Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.30 KB | None | 0 0
  1. /*
  2.  * gameutil.h
  3.  *
  4.  * Contains essential variables and functions for manipulating the game of checkers.
  5.  *
  6.  * Matthew Renze
  7.  */
  8. #ifndef GAMEUTIL_H
  9. #define GAMEUTIL_H
  10.  
  11. #include "movelist.h"
  12. /**
  13.  * Stores the current layout of the board
  14.  */
  15. char board[8][8];      
  16. /**
  17.  * Load rules turn, board and moves from input
  18.  */
  19. int load_config(FILE*);        
  20. /**
  21.  * True if currently black's turn
  22.  */
  23. int is_black_turn();               
  24. /**
  25.  * True if capture rule not enforced
  26.  */
  27. int is_no_capture();
  28. /**
  29.  * True if multiple jumps allowed
  30.  */
  31. int is_multiple_jumps();
  32. /**
  33.  * Count the number of black pawns on the board
  34.  */
  35. int num_black_pawns(char G[8][8]);
  36. /**
  37.  * Count the number of black kings on the board
  38.  */
  39. int num_black_kings(char[8][8]);
  40. /**
  41.  * Count the number of red pawns on the board
  42.  */
  43. int num_red_pawns(char[8][8]);
  44. /**
  45.  * Count the number of red kings on the board
  46.  */
  47. int num_red_kings(char[8][8]);
  48. /**
  49.  * Gets the number of moves from the config
  50.  */
  51. int get_num_moves();   
  52. /**
  53.  * Attempt to execute a move
  54.  */
  55. int do_move(char[8][8], char*);
  56. /**
  57.  * Get list of possible moves
  58.  */
  59. Node* get_possible_moves(char[8][8], int); 
  60. /**
  61.  * Get score for a given move
  62.  */
  63. int get_score_for_move(char[8][8], char*, int, int);
  64. /**
  65.  * Get list of moves
  66.  */
  67. Node* get_movelist();
  68.  
  69. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement