-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMastermind.hxx
42 lines (38 loc) · 1.25 KB
/
Mastermind.hxx
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 __MASTERMIND__HXX__
#define __MASTERMIND_HXX__
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <array>
#include <stdexcept>
#include <random>
#include <map>
#include <QString>
enum Colour {Blue, Green, Purple, Orange, Red, White, Black, None};
enum pegBool {black, white, blank};
class Mastermind
{
private:
Colour getRandomColour();
void setResult(int, pegBool);
QString _version_string = "v0.2.0";
public:
std::vector<Colour> player_grid = {None, None, None, None};
void printResult();
static const int grid_size = 4;
static const int game_size = 12;
bool isCorrectPosition(int,Colour);
bool isCorrectColour(Colour);
Colour grid[grid_size];
std::vector<std::vector<Colour> > board;
void setColours();
Colour getColourFromString(std::string);
QString getStrFromColour(Colour);
QString getVersion(){return _version_string;}
std::vector<unsigned int> getPegs();
char getBWCharFromPeg(pegBool);
void _start();
std::vector<std::vector<pegBool>> player_result;
};
#endif