Problem_all_the_time

game.h

Feb 13th, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #ifndef GAME_H_
  2. #define GAME_H_
  3.  
  4. // The main logic of the Connect 4 game. The game rules are in these functions.
  5.  
  6. // Create an empty board.
  7. void InitializeBoard(int board[6][7]);
  8.  
  9. // Draws the game board
  10. void DrawBoard(const int board[6][7], int column);
  11.  
  12. // Play a piece by player at column.
  13. // Returns false if the move is invalid.
  14. bool Drop(int board[6][7], int player, int column);
  15.  
  16. // Returns 0 if no winner yet.
  17. // Returns -1 if draw.
  18. // Returns 1 if player 1 has won.
  19. // Returns 2 if player 2 has won.
  20. int Winner(const int board[6][7]);
  21.  
  22. #endif
  23.  
Advertisement
Add Comment
Please, Sign In to add comment