 /* colors_arduino.ino
  * by Angela Li
  *
- * Arduino controller for Colors, the best game ever! <3 <3 <3 <3 <3
+ * Arduino controller for Colors, the best game ever! <3
  *
  * I/O and game logic. Listens for inputs (push buttons), updates game state, and sends
  * outputs (LEDs, via shift registers). Delegates sundry cuteness to a Node.js app

 *
 */

// Constants are fun!
const int UP = 0;
const int RIGHT = 1;
const int DOWN = 2;
const int LEFT = 3;

// Game state
int board[4][4];
boolean gameInProgress = false;
boolean buttonPressed = false;


        break;

        case LEFT:
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 4; j++) {
                    if (j == 0) {
                        continue;
                    }

                    movedAnythingYet = attemptTileMove(i, j, i, j - 1) || movedAnythingYet;
                }
            }
        break;
    }

    // If no tiles moved, this was an invalid move
    if (!movedAnythingYet) {
        return false;
    }

    // Otherwise, it was valid, so add a new tile
    // TODO

    return true;
}

/* Checks whether the game is still winnable. Calls lostGame() if not. */
void checkLost() {
    for (int i = 0; i < 4; i++) {
        if (attemptMove(i)) {
            return;
        }
    }

    // Whoops, we lost the game
    lostGame();
}

void lostGame() {
    // Update game state
    gameInProgress = false;

    // TODO ~ Do something to show they lost (womp womp)
}

void wonGame() {
    // Update game state
    gameInProgress = false;

    // TODO ~ Do something to show they won (woohooo!)
}

/****************************************
