-
Notifications
You must be signed in to change notification settings - Fork 0
/
Knight_Tour.h
42 lines (32 loc) · 1.54 KB
/
Knight_Tour.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef Knight_Tour_H
#define Knight_Tour_H
#include"structure_and_defines.h"
//* 311452510 *//
//* aviv barkai *//
/******************* Public Function Prototypes *******************/
boardPosArray** validMoves(movesArray** moves, char** board);
pathTree findAllPossiblePaths(boardPos start, movesArray** moves, char** board);
movesList* findPathCoveringAllBoard(boardPos start, movesArray** moves, char** board);
int display(movesList* moves_list, boardPos start, char** board);
void saveListToBinFile(char* file_name, boardPosArray* pos_arr);
int checkAndDisplayPathFromFile(char* file_name, movesArray** moves, char** board);
char** init_board(void);
void convertToboardLocation(unsigned int* row, unsigned int* col, boardPos pos);
char getCell(int row, int col, char** board);
void setCell(int row, int col, char sign, char** board);
int countEmptyCells(char** board);
void convertToMove(int* row, int* col, boardPos pos);
bool InBounds(int row, int col);
bool isEmptyCell(char ch);
void convertToboardLoc(int* row, int* col, boardPos pos);
bool ListIsEmpty(movesList* list);
void makeEmptyList(movesList* list);
void addToBeginningDoublyList(movesList* list, moveCell* cellToAdd);
moveCell* createNewCell(Move moveData, moveCell* prevCell, moveCell* nextCell);
void addToTail(movesList* list, moveCell* cellToAdd);
void DeallocateDoublyListCell(moveCell* xCell);
void CheckMemoryAllocation(void* ptr);
void checkSucceedFileOpen(void* ptr);
void freeMovesList(movesList* list);
void freeTree(pathTree* list);
#endif