Created
November 11, 2015 10:56
-
-
Save poseidon4o/67ad547fdafdbe9a7035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdint> | |
#include <bitset> | |
using namespace std; | |
enum FieldColor { | |
EMPTY = 0, | |
WHITE = 1, | |
BLACK = 1 << 1 | |
}; | |
struct Setter { | |
int index; | |
uint16_t &data; | |
Setter(uint16_t &d, int idx) : data(d), index(idx) {} | |
Setter & operator=(FieldColor fcolor) { | |
data |= (fcolor << index); | |
return *this; | |
} | |
}; | |
struct GRow { | |
uint16_t data; | |
GRow() : data(0) {} | |
Setter operator[](int index) { | |
return Setter(data, index); | |
} | |
}; | |
struct Game { | |
GRow rows[8]; | |
GRow & operator[](int index) { | |
return rows[index]; | |
} | |
}; | |
int main() { | |
while (true) { | |
int row, col; | |
bool isVert; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment