Xinqi Bao's Git
projects
/
CheaterHub.git
/ blob
summary
|
log
|
commit
|
diff
|
tree
history
|
raw
|
HEAD
first commit, implemented game wordscapes
[CheaterHub.git]
/
server
/
wordscapes
/
wordscapes.h
1
#pragma once
2
#include <fstream>
3
#include <string>
4
#include <vector>
5
6
class
Dictionary
7
{
8
private
:
9
class
Node
10
{
11
public
:
12
bool
isWord
=
false
;
13
Node
*
next
[
26
] = {
0
};
14
15
Node
();
16
~
Node
();
17
};
18
Node
*
header
;
19
20
public
:
21
Dictionary
(
const char
*
filename
);
22
~
Dictionary
();
23
24
bool
findWord
(
std
::
string
&
word
);
25
};
26
27
class
Wordscapes
28
{
29
private
:
30
Dictionary
*
dict
;
31
32
void
stripInput
(
std
::
string
&
given
,
std
::
string
&
search
);
33
34
public
:
35
Wordscapes
();
36
~
Wordscapes
();
37
38
std
::
vector
<
std
::
string
>
solve
(
std
::
string
&
given
,
std
::
string
&
search
);
39
};