Problem_all_the_time

ai.h

Feb 15th, 2022
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #ifndef AI_H_
  2. #define AI_H_
  3.  
  4. #include <string>
  5.  
  6. // AI agents for connect 4.
  7. // Each agent corresponds a function. AI functions assume that the board
  8. // is not full and may crash the game if given an invalid board state.
  9. // This file also defines the main types of players (including human),
  10. // and the strings used in command-line flags to pick player types.
  11.  
  12. enum class PlayerType { kHuman, kRandom, kFirst, kInvalid };
  13.  
  14.  
  15. // AI chooses first open space.
  16. // Corresponds to kFirst player type.
  17. int FirstOpenAgent(int board[6][7], int ai_player);
  18.  
  19. // AI chooses a random open space.
  20. // Corresponds to kRandom player type.
  21. int RandomAgent(int board[6][7], int ai_player);
  22.  
  23. // String names of player types.
  24. PlayerType GetPlayerType(const std::string &arg);
  25.  
  26. #endif
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment