-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board.h
45 lines (25 loc) · 914 Bytes
/
Board.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
43
44
45
#ifndef BOARD_H
#define BOARD_H
#include "Trie.h"
#define ROWS 4
#define COLS 4
#define DEFAULT_ALPHABET "abcdefghijklmnopqrstuvwxyz"
#define MUTATION_RATE 0.1
typedef struct Board Board;
typedef struct BoardSolver BoardSolver;
int WordScore(int wordLength);
BoardSolver *BoardSolverInit(Trie *trie, char *alphabet);
void BoardSolverDestroy(BoardSolver *bs);
Board *BoardRandom(BoardSolver *bs);
Board *BoardFromLetters(BoardSolver *bs, char *letters);
Board *BoardMutate(BoardSolver *bs, Board *board);
Board *BoardBreed(BoardSolver *bs, Board *mom, Board *dad);
Board *BoardCopy(Board *board);
void BoardPrint(FILE *stream, Board *board);
void BoardPrintWithStats(FILE *stream, Board *board);
void BoardPrintFoundWords(FILE *stream, Board *board, Trie *trie);
int BoardWordCount(Board *board);
int BoardScore(Board *board);
void BoardRecycle(Board *board);
void BoardGarbageCollect();
#endif