| 
    penguins
    1.0.0
    
   | 
 
Go to the source code of this file.
Macros | |
| #define | ANSI_CSI "\033[" | 
| #define | ANSI_SGR "m" | 
| #define | ANSI_SGR_RESET "0" | 
| #define | ANSI_SGR_BOLD "1" | 
| #define | ANSI_SGR_FORE_COLOR "3" | 
| #define | ANSI_SGR_BACK_COLOR "4" | 
| #define | ANSI_SGR_BLACK "0" | 
| #define | ANSI_SGR_RED "1" | 
| #define | ANSI_SGR_GREEN "2" | 
| #define | ANSI_SGR_YELLOW "3" | 
| #define | ANSI_SGR_BLUE "4" | 
| #define | ANSI_SGR_MAGENTA "5" | 
| #define | ANSI_SGR_CYAN "6" | 
| #define | ANSI_SGR_WHITE "7" | 
| #define | ANSI_RESET ANSI_CSI ANSI_SGR_RESET ANSI_SGR | 
| #define | PLAYER_COLORS_COUNT 5 | 
Functions | |
| static void | clear_screen (void) | 
| void | print_board (const Game *game) | 
| static void | display_new_turn_message (Game *game) | 
| static void | display_error_message (const char *message) | 
| void | print_player_stats (const Game *game) | 
| static bool | scan_coords (Coords *out) | 
| void | print_game_state (const Game *game) | 
| static void | update_game_state_display (const Game *game) | 
| int | run_interactive_mode (void) | 
| static const char * | describe_placement_result (PlacementError result) | 
| void | interactive_placement (Game *game) | 
| void | handle_placement_input (Game *game, Coords *selected) | 
| static const char * | describe_movement_result (MovementError result) | 
| void | interactive_movement (Game *game) | 
| void | handle_movement_input (Game *game, Coords *penguin, Coords *target) | 
Variables | |
| static const char *const | PLAYER_ANSI_COLORS [PLAYER_COLORS_COUNT] | 
| static const char *const | PLAYER_COLOR_NAMES [PLAYER_COLORS_COUNT] | 
| #define ANSI_CSI "\033[" | 
Definition at line 19 of file interactive.c.
| #define ANSI_SGR "m" | 
Definition at line 20 of file interactive.c.
| #define ANSI_SGR_RESET "0" | 
Definition at line 21 of file interactive.c.
| #define ANSI_SGR_BOLD "1" | 
Definition at line 22 of file interactive.c.
| #define ANSI_SGR_FORE_COLOR "3" | 
Definition at line 23 of file interactive.c.
| #define ANSI_SGR_BACK_COLOR "4" | 
Definition at line 24 of file interactive.c.
| #define ANSI_SGR_BLACK "0" | 
Definition at line 25 of file interactive.c.
| #define ANSI_SGR_RED "1" | 
Definition at line 26 of file interactive.c.
| #define ANSI_SGR_GREEN "2" | 
Definition at line 27 of file interactive.c.
| #define ANSI_SGR_YELLOW "3" | 
Definition at line 28 of file interactive.c.
| #define ANSI_SGR_BLUE "4" | 
Definition at line 29 of file interactive.c.
| #define ANSI_SGR_MAGENTA "5" | 
Definition at line 30 of file interactive.c.
| #define ANSI_SGR_CYAN "6" | 
Definition at line 31 of file interactive.c.
| #define ANSI_SGR_WHITE "7" | 
Definition at line 32 of file interactive.c.
| #define ANSI_RESET ANSI_CSI ANSI_SGR_RESET ANSI_SGR | 
Definition at line 34 of file interactive.c.
| #define PLAYER_COLORS_COUNT 5 | 
Definition at line 36 of file interactive.c.
      
  | 
  static | 
Definition at line 44 of file interactive.c.
Referenced by run_interactive_mode(), and update_game_state_display().
| void print_board | ( | const Game * | game | ) | 
Definition at line 53 of file interactive.c.
Referenced by print_game_state().
      
  | 
  static | 
Definition at line 88 of file interactive.c.
Referenced by interactive_movement(), and interactive_placement().
      
  | 
  static | 
Definition at line 98 of file interactive.c.
Referenced by handle_movement_input(), and handle_placement_input().
| void print_player_stats | ( | const Game * | game | ) | 
Definition at line 102 of file interactive.c.
Referenced by print_game_state().
      
  | 
  static | 
Definition at line 116 of file interactive.c.
Referenced by handle_movement_input(), and handle_placement_input().
| void print_game_state | ( | const Game * | game | ) | 
Definition at line 122 of file interactive.c.
Referenced by run_autonomous_mode(), and update_game_state_display().
      
  | 
  static | 
Definition at line 128 of file interactive.c.
Referenced by interactive_movement(), interactive_placement(), and run_interactive_mode().
| int run_interactive_mode | ( | void | ) | 
Definition at line 133 of file interactive.c.
Referenced by main().
      
  | 
  static | 
Definition at line 207 of file interactive.c.
Referenced by handle_placement_input().
| void interactive_placement | ( | Game * | game | ) | 
Definition at line 220 of file interactive.c.
Referenced by run_interactive_mode().
Definition at line 234 of file interactive.c.
Referenced by interactive_placement().
      
  | 
  static | 
Definition at line 250 of file interactive.c.
Referenced by handle_movement_input().
| void interactive_movement | ( | Game * | game | ) | 
Definition at line 267 of file interactive.c.
Referenced by run_interactive_mode().
Definition at line 282 of file interactive.c.
Referenced by interactive_movement().
      
  | 
  static | 
Definition at line 37 of file interactive.c.
Referenced by display_new_turn_message(), print_board(), print_player_stats(), and run_interactive_mode().
      
  | 
  static | 
Definition at line 40 of file interactive.c.
Referenced by run_interactive_mode().