   bool anyInvalid = false;
   bool anyEmpty = false;
   bool anyWallConstrainsViolated = false;
+  int switchesOn = 0;
   for (int index = 0; index < GRIDSIZE * GRIDSIZE; index++) {
     int row = getRow(index);
     int col = getCol(index);
     if (isWall(row, col)) {
       continue;
     } else if (isSwitchOn(row, col)) {
+      switchesOn++;
       if (illuminationCount(row, col) > 1) {
         anyInvalid = true;
         setColor(row, col, RED);  // Conflicting lights.


// Arduino setup() and loop()
void setup() {
  if (USE_SERIAL) {
    Serial.begin(9600);
  }
  pinMode(LED_BUILTIN, OUTPUT);

  // Initial switch pins as INPUTs.
  for (int switch_index = 0; switch_index < GRIDSIZE * GRIDSIZE; switch_index++) {
    int pin = getSwitchPin(getRow(switch_index), getCol(switch_index));
    if (pin != NO) {
      pinMode(pin, INPUT);      
    }
  }
  
  // PololuLedStripBase::interruptFriendly = true;



#define NO 98  // Represents no pin
const uint16_t SWITCH_PINS[] = {
  13, 26,  9, 10, 48, NO, 32,
  NO, 17, 16, NO, 47, 50, 34,
   7,  6, 15,  8, 46, 51, 36,
  28, NO, 30, 22, 45, NO, 35,
  25, 37, 39, 41, 42, 44, 33,
  24, 27, 29, NO, 43, 52, NO,
  25, NO, 31, 38, 40, 49, 53,
};

const uint16_t LED_INDEXES[] = {
