exercism/c/queen-attack/queen_attack.h

27 lines
703 B
C
Raw Permalink Normal View History

2024-06-16 11:49:53 -04:00
#ifndef QUEEN_ATTACK_H
#define QUEEN_ATTACK_H
#include <stdint.h>
typedef enum { CAN_NOT_ATTACK, CAN_ATTACK, INVALID_POSITION } attack_status_t;
typedef struct {
uint8_t row;
uint8_t column;
} position_t;
attack_status_t can_attack(position_t queen_1, position_t queen_2);
int same_position(position_t queen_1, position_t queen_2);
int valid_position(position_t queen_1, position_t queen_2);
attack_status_t first_diagonal(position_t queen_1, position_t queen_2);
attack_status_t second_diagonal(position_t queen_1, position_t queen_2);
attack_status_t third_diagonal(position_t queen_1, position_t queen_2);
attack_status_t fourth_diagonal(position_t queen_1, position_t queen_2);
#endif