reversi.h 546 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <furi.h>
  3. #include <stdbool.h>
  4. #ifndef __cplusplus
  5. #define max(a, b) (((a) > (b)) ? (a) : (b))
  6. #define min(a, b) (((a) < (b)) ? (a) : (b))
  7. #endif
  8. #define BLACK 1
  9. #define WHITE -1
  10. #define BOARD_SIZE 8
  11. typedef struct {
  12. int8_t board[BOARD_SIZE][BOARD_SIZE];
  13. int8_t current_player;
  14. int8_t human_color;
  15. uint8_t cursor_x;
  16. uint8_t cursor_y;
  17. uint8_t is_game_over;
  18. } GameState;
  19. void init_game(GameState* state);
  20. void computer_move(GameState* game_state);
  21. void human_move(GameState* game_state);