anchor.diff:  
   /// Returns the number of lights that are lit after following all the
   /// [instructions].
  +///
  +/// Throws an [Exception] if any of the instructions is invalid.
   int partOne(List<String> instructions) {
     var lights = new List<List<bool>>.generate(1000, (_) =>
         new List<bool>.filled(1000, false));
  +
  +  return _followInstructions(instructions, lights, _doTaskOne);
  +}
  +
  +/// Returns the total brightness of all lights after following all the
  +/// [instructions].
  +///
  +/// Throws an [Exception] if any of the instructions is invalid.
  +int partTwo(List<String> instructions) {
  +  var lights = new List<List<int>>.generate(1000, (_) =>
  +      new List<int>.filled(1000, 0));
  +  return _followInstructions(instructions, lights, _doTaskTwo);
  +}
  +
  +/// Abstract function to return the result after following the [instructions]
  +/// to change the [lights] by calling [doTask].
  +///
  +/// Throws an [Exception] if any of the instructions is invalid.
  +int _followInstructions(List<String> instructions, List<List> lights,
  +    Function doTask) {
     var task;
     var startX, startY;
     var endX, endY;
     var match;
  -  var lit = 0;
  +  var result = 0;
  +  var change;
   
     RegExp exp = new RegExp(r'(turn \w+|toggle) (\d+),(\d+) through (\d+),(\d+)');
   
  
positive.code: 
      for (var x = startX; x <= endX; x++) {
        for (var y = startY; y <= endY; y++) {
          switch (task) {
            case 'turn on':
              if (!lights[x][y]) lit++;
              lights[x][y] = true;
              break;
            case 'turn off':
              if (lights[x][y] && lit > 0) lit--;
              lights[x][y] = false;
              break;
            case 'toggle':
              lit += lights[x][y] ? (lit > 0 ? -1 : 0) : 1;
              lights[x][y] = !lights[x][y];
              break;
          }
        }
      }
    }
  
    return lit;
  }
  
negative.code:     var input = readInput('day6');
      var strings = input.split('\n');
      print('Part one: ${partOne(strings)}');
      print('Part two: ${partTwo(strings)}');
    } on FileSystemException catch (e) {
      print('Error reading input from file: $e');
    } catch (e) {
  