-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_classes.h
More file actions
43 lines (37 loc) · 805 Bytes
/
Copy pathbasic_classes.h
File metadata and controls
43 lines (37 loc) · 805 Bytes
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
#include <random>
#include <algorithm>
#include <vector>
#include <cassert>
#ifndef BASIC_CLASSES_H
#define BASIC_CLASSES_H
const int INF = (int)1e8;
class Response {
private:
int cows, bulls;
public:
Response();
Response(int cows, int bulls);
int get_cows() const;
int get_bulls() const;
int get_cows_and_bulls() const;
};
class Oracle {
protected:
std::size_t n, m;
std::vector <int> secret_string;
public:
std::size_t get_n() const;
std::size_t get_m() const;
virtual Response query(const std::vector <int> &query_string) = 0;
};
class Player {
protected:
Oracle *oracle;
int score;
bool end;
public:
virtual Response query(const std::vector <int> &query_string) = 0;
int get_score() const;
bool is_end() const;
};
#endif