For those of you that have submitted an entry, you might want to check yourself against the judging code. It's sad to see promising entries fail to stay within the bounds. Make sure that your code accounts for variances in the bounds and bonus. I played with the idea of introducing negative integers in some of those arguments, but I figured I'd stick with non-negative integers since it made more sense with the storyline. In short, don't worry about negative integers for the bounds or the bonus; it's all non-negative integers only.
Need some extra players? I used the following class:
Code:
template <int constant>
class Constant : public Contest::TravellersDilemma
{
int ChooseNumber(int previousEarning, int lowerBound,
int upperBound, int bonus)
{
return constant;
}
};
To aid in using the judging code, here's a snippet:
Code:
//Seed up the rng
std::srand(std::time(0));
std::vector<std::pair<Contest::TravellersDilemma*, int> > players;
//push_back all the players with a 0
//i.e. players.push_back(std::make_pair(new Constant<2>(), 0));
std::vector<std::ostream*> streams;
//If you want some output to the console.
streams.push_back(&std::cout);
//Personally, I find this much more useful.
streams.push_back(new std::ofstream("simulation.txt"));
//Make sure you can at least play the standard game
Contest::TravellersDilemmaJudge judge(players, 2, 100, 2, 10, streams);
judge.Go();