-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot_interface.h
44 lines (36 loc) · 1.03 KB
/
bot_interface.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
#pragma once
#include <string>
#define ROCK 0
#define PAPER 1
#define SCISSORS 2
#define ROUNDS 1000
/*
Interface for a bot. Inherit your own bot from this.
*/
class Bot
{
public:
// Return name of your bot.
// Using good taste is allowed.
virtual std::string get_name() = 0;
// Get bot's throw (ROCK, PAPER, or SCISSORS)
// on given round (0..999). Before making
// its decisions, your bot should study
// opponent's earlier throws (see opp_throw).
virtual int get_throw(int round) = 0;
virtual void set_value(signed int value) {};
virtual bool am_i_learning(){ return false; }
// Opponent's throws on previous rounds.
// Your bot can study these in get_throw(),
// valid indices go from [0] to [round - 1].
// This array is automatically filled
// for you as the match progresses.
int opp_throw[ROUNDS];
// Your bot's own, earlier throws,
// just in case you need it.
// This array is automatically filled
// for you as the match progresses.
int own_throw[ROUNDS];
// Don't bother about this...
virtual ~Bot() {}
};