anchor.diff:  
     switch (uMsg) {
       case WM_SIZE:
  -      final ClientRect = RECT.allocate();
  -      GetClientRect(hwnd, ClientRect.addressOf);
  -      final Width = ClientRect.right - ClientRect.left;
  -      final Height = ClientRect.bottom - ClientRect.top;
  -      init(Width, Height);
  +      final rect = RECT.allocate();
  +      GetClientRect(hwnd, rect.addressOf);
  +      final width = rect.right - rect.left;
  +      final height = rect.bottom - rect.top;
  +
  +      init(width, height);
  +      free(rect.addressOf);
         break;
   
  +    case WM_CLOSE:
  +      isRunning = false;
  +      break;
  +
       case WM_DESTROY:
  -      PostQuitMessage(0);
  -      break;
  -
  -    case WM_GETMINMAXINFO:
  -      final info = Pointer<MINMAXINFO>.fromAddress(lParam).ref;
  -      info.ptMinTrackSizeX = 400;
  -      info.ptMinTrackSizeY = 400;
  +      KillTimer(hwnd, IDT_TIMER1);
  +      isRunning = false;
         break;
   
       case WM_PAINT:
         final ps = PAINTSTRUCT.allocate();
         final dc = BeginPaint(hwnd, ps.addressOf);
  -      final X = ps.rcPaintL;
  -      final Y = ps.rcPaintT;
  -      final Width = ps.rcPaintR - ps.rcPaintL;
  -      final Height = ps.rcPaintB - ps.rcPaintT;
  +      final x = ps.rcPaintL;
  +      final y = ps.rcPaintT;
  +      final width = ps.rcPaintR - ps.rcPaintL;
  +      final height = ps.rcPaintB - ps.rcPaintT;
   
         final rect = RECT.allocate();
         GetClientRect(hwnd, rect.addressOf);
  -      update();
  -      draw(dc, rect, X, Y, Width, Height);
  +      gameTick();
  +      draw(dc, rect, x, y, width, height);
         EndPaint(hwnd, ps.addressOf);
  +
  +      free(rect.addressOf);
         free(ps.addressOf);
         break;
   
  
positive.code: void gameOver() {
    Beep(350, 300);
    KillTimer(hWnd, IDT_TIMER1);
    gameoverRow = 0;
    SetTimer(hWnd, IDT_TIMER2, 20, nullptr);
  }
  
  
negative.code:   wc.lpfnWndProc = Pointer.fromFunction<WindowProc>(MainWindowProc, 0);
    wc.hInstance = hInstance;
    wc.lpszClassName = CLASS_NAME;
    if (RegisterClass(wc.addressOf) != 0) {
      // Create the window.
  
      hWnd = CreateWindowEx(
          0, // Optional window styles.
          CLASS_NAME, // Window class
          TEXT('WinSnake'), // Window caption
          WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE,
  
          // Size and position
          CW_USEDEFAULT,
          CW_USEDEFAULT,
          800,
          600,
          NULL, // Parent window
          NULL, // Menu
          hInstance, // Instance handle
          nullptr // Additional application data
          );
  
      if (hWnd != 0) {
        SetTimer(hWnd, IDT_TIMER1, timerAmount, nullptr);
  
        isRunning = true;
        while (isRunning) {
          // Run the message loop.
  
          final msg = MSG.allocate();
          while (PeekMessage(msg.addressOf, 0, 0, 0, PM_REMOVE) != 0) {
            if (msg.message == WM_QUIT) {
              isRunning = false;
            }
            TranslateMessage(msg.addressOf);
            DispatchMessage(msg.addressOf);
          }
          free(msg.addressOf);
  
          final dc = GetDC(hWnd);
          final rect = RECT.allocate();
          GetClientRect(hWnd, rect.addressOf);
          final windowWidth = rect.right - rect.left;
          final windowHeight = rect.bottom - rect.top;
          draw(dc, rect, 0, 0, windowWidth, windowHeight);
          ReleaseDC(hWnd, dc);
        }
      } else {
        MessageBox(0, TEXT('Failed to create window'), TEXT('Error'),
            MB_ICONEXCLAMATION | MB_OK);
      }
    } else {
      MessageBox(0, TEXT('Failed to create window'), TEXT('Error'),
          MB_ICONEXCLAMATION | MB_OK);
    }
  }
  