Last active
August 29, 2015 14:05
-
-
Save W-Net-AI/63513647e17c3e2bf06b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun set-br (self val) | |
(let ((a (cons self nil)) | |
(rect-x (@ self :int)) | |
(rect-y (@ self :int 1)) | |
(rect-width (@ self :int 2)) | |
(rect-height (@ self :int 3)) | |
(point-x (@ val :int)) | |
(point-y (@ val :int 1)) | |
(new-x) | |
(new-y)) | |
(if (>= point-x rect-x) | |
(setf new-x (- point-x rect-width))) | |
(if (>= point-y rect-y) | |
(setf new-y (- point-y rect-height))) | |
(if (<= point-x rect-x) | |
(setf new-x (- point-x rect-width))) | |
(if (<= point-y rect-y) | |
(setf new-y (- point-y rect-height))) | |
(setf (car a) (rect new-x new-y rect-width rect-height))(car a))) | |
(defun mutate (cons) | |
(let ((a (cons cons nil))) | |
(setf (car a) 5)(car a))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment