This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
sys_prog/chess_paths/chess_paths.h

25 lines
762 B
C

#ifndef CHESS_PATHS_H_INCLUDED
#define CHESS_PATHS_H_INCLUDED
enum chess_piece { KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN };
/* Implemented by the application: */
struct chessboard;
int value_at(const struct chessboard * c, unsigned column, unsigned row);
unsigned int columns(const struct chessboard * c);
unsigned int rows(const struct chessboard * c);
struct piece_position {
enum chess_piece piece;
unsigned int column;
unsigned int row;
};
/* Implemented by you: */
unsigned int increasing_path_len(const struct chessboard * c, struct piece_position * p);
unsigned int decreasing_path_len(const struct chessboard * c, struct piece_position * p);
unsigned int simple_path_len(const struct chessboard * c, struct piece_position * p);
#endif