anchor.diff:  
   Point direction = Point();
   List<Point> snakePoints = <Point>[];
  +List<List<int>> data = [<int>[]];
   
   class Point {
     int x;
  
positive.code: 
  void setApple() {
    // clear old apple just in case
    data[appley][applex] = 0;
    // get a random x y in our 2d vector coordinate space
    final x = RandRange(0, (bitmapWidth / 10.0).floor());
    final y = RandRange(0, (bitmapHeight / 10.0).floor());
    // set to 1 to represent apple
    if (data[y][x] == 0) {
      data[y][x] = 1;
  
negative.code:   }
  }
  
  void setVectorToMemory() {
    var vecX = 0;
    var vecY = 0;
  
    final pitch = bitmapWidth * bytesPerPixel;
  
    final ptr = Pointer<Uint8>.fromAddress(bitmapMemory.address);
  
    var rowOffset = 0;
    for (var y = 0; y < bitmapHeight; ++y) {
      var pixelOffset = rowOffset;
      for (var x = 0; x < bitmapWidth; ++x) {
        if (data[vecY][vecX] == 1) {
          // Apple
          //blue
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //green
          ptr.elementAt(pixelOffset).value = 255;
          pixelOffset++;
  
          //red
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
        } else if (data[vecY][vecX] == 2) {
          // snake
          //blue
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //green
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //red
          ptr.elementAt(pixelOffset).value = 255;
          pixelOffset++;
  
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
        } else if (data[vecY][vecX] == 3) {
          // ???
          //blue
          ptr.elementAt(pixelOffset).value = 255;
          pixelOffset++;
  
          //green
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //red
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
        } else if (data[vecY][vecX] == 4) {
          //set to purple
          //blue
          ptr.elementAt(pixelOffset).value = 226;
          pixelOffset++;
  
          //green
          ptr.elementAt(pixelOffset).value = 43;
          pixelOffset++;
  
          //red
          ptr.elementAt(pixelOffset).value = 138;
          pixelOffset++;
  
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
        } else {
          //blue
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //green
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          //red
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
  
          ptr.elementAt(pixelOffset).value = 0;
          pixelOffset++;
          // move along
          //++Pixel;
          //++Pixel;
          //++Pixel;
          //++Pixel;
        }
        vecX = (x / 10).floor();
      }
      rowOffset += pitch;
      vecY = (y / 10).floor();
    }
  }
  
  void resetGame() {
    appleX = 0;
    appleY = 0;
    timerAmount = 100;
  
    // init snake direction
    direction.x = 1;
    direction.y = 0;
  
    // init snake
    snakePoints.clear();
    final p1 = Point();
    p1.x = 3;
    p1.y = 0;
    snakePoints.add(p1);
  
    final p2 = Point();
    p2.x = 2;
    p2.y = 0;
    snakePoints.add(p2);
  
    final p3 = Point();
    p3.x = 1;
    p3.y = 0;
    snakePoints.add(p3);
  
    final p4 = Point();
    p4.x = 0;
    p4.y = 0;
    snakePoints.add(p4);
  
    for (var i = 0; i < snakePoints.length; i++) {
      data[snakePoints[i].y][snakePoints[i].x] = 2;
    }
  
    setApple();
    setVectorToMemory();
  
    SetTimer(hWnd, IDT_TIMER1, timerAmount, nullptr);
  }
  
  void gameOver() {
    Beep(350, 300);
    KillTimer(hWnd, IDT_TIMER1);
    gameoverRow = 0;
    SetTimer(hWnd, IDT_TIMER2, 20, nullptr);
  }
  
  void gameover_update_complete() {
    KillTimer(hWnd, IDT_TIMER2);
    resetGame();
  }
  
  void gameover_update() {
    if (wipedown) {
      for (var x = 0; x <= data[gameoverRow].length; x++) {
        data[gameoverRow][x] = 4;
      }
      setVectorToMemory();
      gameoverRow++;
      if (gameoverRow >= blocksPerHeight - 1) {
        gameoverRow = blocksPerHeight - 1;
        wipedown = false;
      }
    } else {
      for (var x = data[gameoverRow].length; x > -1; x--) {
        data[gameoverRow][x] = 0;
      }
      setVectorToMemory();
      gameoverRow--;
      if (gameoverRow < 0) {
        gameover_update_complete();
        wipedown = true;
      }
    }
  }
  
  void init(int width, int height) {
    // we are initializing the bitmap memory buffer here
    // this can be called on resize too but for now stick to fixed window
  
    if (bitmapMemory != nullptr) {
      VirtualFree(bitmapMemory, 0, MEM_RELEASE);
    }
  
    bitmapWidth = width;
    bitmapHeight = height;
  
    bitmapInfo.biSize = sizeOf<BITMAPINFO>();
    bitmapInfo.biWidth = width;
    bitmapInfo.biHeight = height;
    bitmapInfo.biPlanes = 1;
    bitmapInfo.biBitCount = 32;
    bitmapInfo.biCompression = BI_RGB;
  