From 249a51d37e14b4380a78fce2db4709cee981fa11 Mon Sep 17 00:00:00 2001 From: Francesco Bariatti <francesco.bariatti@insa-rennes.fr> Date: Wed, 16 Dec 2015 00:42:29 +0100 Subject: [PATCH] Fixed max move number when the computer chooses: before it could choose a move number that was more than the maximum allowed --- src/game/morpion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/morpion.cpp b/src/game/morpion.cpp index cf61680..2703026 100644 --- a/src/game/morpion.cpp +++ b/src/game/morpion.cpp @@ -209,7 +209,7 @@ namespace game { while (!end_of_game()) { - uniform_int_distribution<uint16_t> distribution(0, 8-state.total_moves); + uniform_int_distribution<uint16_t> distribution(0, number_of_moves() -1); uint16_t move = distribution(engine); play(move); } -- GitLab