anchor.diff:                                       (pathname-name file-pn) i))
                         (subseq fold-specs 0 i)))
             (%once file fold-specs)))))
  +
  +(defclass game-state ()
  +  ((field :type list
  +          :documentation "All polygons on the field"
  +          :accessor field
  +          :initarg :field)
  +   (adjustment-matrix :type list
  +                      :documentation "list of lists of values, describes translation of original problem"
  +                      :accessor adjustment-matrix
  +                      :initarg :adjustment-matrix)
  +   (target-field :type list
  +                 :documentation "List of polygons describing desired final state"
  +                 :accessor target-field
  +                 :initarg :target-field)))
  +
  +(defmethod clone-state (_ (st game-state))
  +  st)
  +
  +(defclass action ()
  +  ((folding-line :accessor folding-line
  +                 :type 'line
  +                 :initarg :folding-line)
  +   (folding-side :accessor folding-side
  +                 :type 'point
  +                 :initarg :folding-side)))
  +
  +(defmethod next-state (_ (st game-state) action)
  +  (copy-instance
  +   st
  +   :field (fold-polygon-list (field st)
  +                             (folding-line action)
  +                             (folding-side action))))
  +
  +(defun find-non-collinear-point (line polygon)
  +  (dolist (pt (point-list polygon))
  +    (let ((pt-sign (line-equation-res line pt)))
  +      (unless (= pt-sign 0)
  +        (return-from find-non-collinear-point
  +          (values pt pt-sign)))))
  +  nil)
  +
  +(defmethod possible-actions (_ (st game-state))
  +  (loop for polygon in (target-field st) append
  +       (loop for edge in (edge-list polygon) append
  +            (let* ((line (line-from-segment edge))
  +                   (direction-point
  +                    (find-non-collinear-point line polygon)))
  +              (when direction-point
  +                (list
  +                 (make-instance
  +                  'action
  +                  :folding-line line
  +                  :folding-side direction-point)))))))
  
positive.code:                (assert1 (mapcar #'polygon->list res) expected))))
      (%test :a 0 :b 1 :c -1
             :coords '(0 0 0 2 2 2 2 0)
             :expected '((0 0 0 1 2 1 2 0)
                         (0 1 0 2 2 2 2 1)))
      (%test :a 0 :b 1 :c -2
             :coords '(0 0 0 2 2 2 2 0)
             :expected '((0 0 0 2 2 2 2 0)))
      (%test :a -1 :b 1 :c (- (/ 1 4))
             :coords '(0 0 0 1 1 1 1 0)
             :expected '((0 0 0 1/4 3/4 1 1 1 1 0)
                         (0 1/4 0 1 3/4 1)))))
  
  (defun mirror-polygon (polygon line)
    (make-polygon-from-point-list
  
negative.code: (defpackage :src/simple-state
    (:use :common-lisp
          :2d-geometry
          :src/utils
          :src/drawer
          :src/mcts)
    (:import-from :2d-geometry
                  :point-equal-p))
  
  