anchor.diff:      (when reset
         (loop for row from 0 to 3 do
           (loop for col from 0 to 3 do
  -          (setf (value (index (board this) row col)) 0)))
  -      (add-random this)
  -      (add-random this))
  +          (setf (bval row col) 0)))
  +      (add-random this 2))
       (when quit
         (#_QCoreApplication::exit 0))))
     
  
positive.code:   ; assume no change, set to true on change
    (let ((change nil))
      ; for each row
      (loop for i from 0 to 3 do
        ; for each column
        (loop for j from 0 to 3 do
          ; when this cell is not zero
          (when (/= (value (index (board this) i j)) 0)
            ; for each cell from here to 1
            (loop for k from j downto 1 do
              ; if it can move to the right
              (when (= (value (index (board this) i (- j k))) 0)
                ; move it
                (setf (value (index (board this) i (- j k))) (value (index (board this) i j)))
                (setf (value (index (board this) i j)) 0)
                (setf change t)))))
        ; for each column
        (loop for j from 0 to 3 do
          ; if it can be combined
          (when (and (< (+ j 1) 4) (= (value (index (board this) i j)) (value (index (board this) i (+ j 1)))))
            ; combine it
            (setf (value (index (board this) i j)) (* (value (index (board this) i j)) 2))
            (setf (value (index (board this) i (+ j 1))) 0)
            (when (/= (value (index (board this) i j)) 0)
              (setf change t))))
        ; check again to see if we can move things to the left
        (loop for j from 0 to 3 do
          (when (/= (value (index (board this) i j)) 0)
            (loop for k from j downto 1 do
              (when (= (value (index (board this) i (- j k))) 0)
                (setf (value (index (board this) i (- j k))) (value (index (board this) i j)))
                (setf (value (index (board this) i j)) 0)
                (setf change t))))))
      ; whether there was any change
      change))
  
negative.code:       (loop for col from 0 to 3 collect
          (make-instance 'cell-widget :val 0))))
    ; add two randoms and update the board
    (add-random this 2)
    (update-board this)
    ; initialize the space (x, y, w, h) and title
    (#_setWindowTitle this "2048 Game")
    ; add a grid layout of cells
    (let ((grid (#_new QGridLayout this)))
      (board-loop
        (#_addWidget grid (index (board this) row col) row col))
      (#_setLayout this grid)))
  
  ; make a new window
  