game_theory_tournament/source/RandomPlayer.hpp
2024-06-28 17:08:57 +02:00

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;
}
};