summaryrefslogtreecommitdiff
path: root/ai_rand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ai_rand.cpp')
-rw-r--r--ai_rand.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/ai_rand.cpp b/ai_rand.cpp
index 7479d01..c4df24e 100644
--- a/ai_rand.cpp
+++ b/ai_rand.cpp
@@ -11,9 +11,8 @@ int RAND::calcMove(Board &bd, uint8_t myclr) {
(void)myclr;
assert(bd.bag.totalLeft() > 0);
- int moves[BSZ * BSZ], nmoves = 0;
- bd.forEachMove([&moves, &nmoves](int idx) { moves[nmoves++] = idx; });
+ const vector<int> &moves = bd.getEdgeCells();
- assert(nmoves > 0);
- return moves[random() % nmoves];
+ assert(moves.size() > 0);
+ return moves[random() % moves.size()];
}