blob: 62394d563b0dc02151010cb66f7f2b27937bb25e (
plain)
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
|
#pragma once
/*
* NO NOT ADAPT THIS FILE
*/
class NumberGuessGame
{
public:
NumberGuessGame();
NumberGuessGame( unsigned );
virtual ~NumberGuessGame();
public:
virtual void createNewNumber();
virtual unsigned getLowerBound() const;
virtual unsigned getUpperBound() const;
public:
enum RESULT { TOOLOW=-1, FOUND=0, TOOHIGH=1 };
virtual enum RESULT guess( unsigned );
virtual unsigned numberOfGuesses() const;
private:
virtual void initialize( unsigned );
virtual double uniform() const;
private:
unsigned m_uLowerBound;
unsigned m_uUpperBound;
unsigned m_uNumberToGuess;
unsigned m_uNumberOfGuesses;
};
|