From 2899820bccb5ec8cfc0f2b1c5e8e04ebec5ece57 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Thu, 6 Feb 2025 10:43:07 +0100 Subject: [PATCH] created a very stupid player that plays random moves --- cpp/src/ais/v0_random.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cpp/src/ais/v0_random.cpp diff --git a/cpp/src/ais/v0_random.cpp b/cpp/src/ais/v0_random.cpp new file mode 100644 index 0000000..82f569c --- /dev/null +++ b/cpp/src/ais/v0_random.cpp @@ -0,0 +1,8 @@ +#include "ai.hpp" + +std::string ai::v1_simple::search(std::string pos, int depth) { + Board b = Board::setup_fen_position(pos); + std::vector moves = b.all_legal_moves(); + + return moves[rand() % moves.size()].to_string(); +}