summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 80d0fb8..c53f5ae 100644
--- a/main.cpp
+++ b/main.cpp
@@ -3,6 +3,7 @@
#include <sys/time.h>
#include "board.h"
#include "mc.h"
+#include "ui.h"
#include "util.h"
using namespace std;
@@ -15,15 +16,23 @@ int main() {
Board bd = Board::makeEmpty();
cerr << "Initial stone at " << Idx(BSZ * BMID + BMID) << endl;
- bd.put(BSZ * BMID + BMID, 1);
+ bd.put(BSZ * BMID + BMID, bd.bag.drawRandom());
cout << bd << endl;
- uint8_t onturn = 2;
+ uint8_t onturn = 1;
while (bd.bag.totalLeft() > 0) {
cout << "--- NEXT TURN: " << Stone(onturn) << " ---" << endl;
- int idx = MC::calcMove(bd, onturn);
+ int idx;
+
+ if (onturn == 1) {
+ cout << "YOUR TURN." << endl;
+ idx = UI::getMove(bd);
+ } else {
+ idx = MC::calcMove(bd, onturn);
+ }
+
uint8_t clr = bd.bag.drawRandom();
uint8_t win = bd.putCW(idx, clr);