diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2019-02-13 21:08:37 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-02-13 21:08:37 +0100 |
commit | 6175cb1c53772cc92d91a39a254c38bdf8f64905 (patch) | |
tree | 3a7dd5f8810d0c859faaf5ab985afc51841899a8 /util.h |
Initial: working monte carlo AI
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#pragma once + +#include <iostream> +#include "params.h" + +using namespace std; + + +#define NEXTTURN(_clr) ((_clr) % NC + 1) + + +struct Idx { + inline Idx(int idx) : x(idx % BSZ), y(idx / BSZ) {} + + int x, y; +}; + +inline ostream& operator<<(ostream &os, const Idx &obj) { + return os << '(' << obj.x << ',' << obj.y << ')'; +} |