mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 06:43:09 -05:00
26 lines
703 B
C
26 lines
703 B
C
#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
|