summaryrefslogtreecommitdiff
path: root/util.h
blob: e89055522cba928e4c5af7a36a9e549fbf6fe2d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 << ')';
}