18 lines
345 B
C++
18 lines
345 B
C++
#include "Player.hpp"
|
|
|
|
#include <stdlib.h>
|
|
|
|
class RandomPlayer : public Player {
|
|
public:
|
|
RandomPlayer() {
|
|
name = "Randy";
|
|
}
|
|
|
|
void new_game() override { ; }
|
|
void push_result(reaction_t opponents_last_reaction) override { ; }
|
|
|
|
reaction_t play() override {
|
|
return (rand() % 2) ? COOPERATE : CONFLICT;
|
|
}
|
|
};
|