diff options
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 << ')'; +} |