Add solution for 2016 Day 1
This commit is contained in:
@@ -9,6 +9,20 @@ struct Index2D
|
||||
int x = -1;
|
||||
int y = -1;
|
||||
|
||||
void RotateCW()
|
||||
{
|
||||
int tmp = y;
|
||||
y = x;
|
||||
x = -tmp;
|
||||
}
|
||||
|
||||
void RotateCCW()
|
||||
{
|
||||
int tmp = y;
|
||||
y = -x;
|
||||
x = tmp;
|
||||
}
|
||||
|
||||
bool IsValid()
|
||||
{
|
||||
return x != -1 && y != -1;
|
||||
|
||||
Reference in New Issue
Block a user