game_theory_tournament/source/RandomPlayer.hpp

18 lines
345 B
C++
Raw Normal View History

2024-06-28 11:08:57 -04:00
#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;
}
};