-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGuess.h
52 lines (42 loc) · 1.03 KB
/
Guess.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
46
47
48
49
50
51
52
// /////////////////////////////////////////////////////////
//
// File: clerdle/Guess.h
// Author: Michael Foster
// Date: 2022.04.29
//
// This is the header file for Guess.cpp.
// See that file for more information.
//
// /////////////////////////////////////////////////////////
#ifndef GUESS_H
#define GUESS_H
#include <vector>
#include <string>
#define PUZZLE_LENGTH 8
class Guess
{
public:
enum charState
{
null, // no data - use default/old value
empty, // no char assigned yet
unknown, // unguessed char (usedChars only)
incorrect, // no match at all
nearby, // right char, wrong place
correct // right char, right place
};
struct GuessChar
{
char character;
charState state;
};
Guess(int length = PUZZLE_LENGTH);
Guess(std::string, int length = PUZZLE_LENGTH);
std::string getString() const;
std::vector<GuessChar> getVector() const;
void setInd(int, GuessChar);
void set(const std::vector<GuessChar> &);
private:
std::vector<GuessChar> guess_;
};
#endif