Skip to content
Snippets Groups Projects
Commit 249a51d3 authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files

Fixed max move number when the computer chooses: before it could choose

a move number that was more than the maximum allowed
parent 141f82f0
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ namespace game ...@@ -209,7 +209,7 @@ namespace game
{ {
while (!end_of_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); uint16_t move = distribution(engine);
play(move); play(move);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment