Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun write-in-diagram-array (diagram destination-descr &optional force-char)
- (destructuring-bind (y x &rest args) destination-descr ; again, reversed x-ys in arrays
- (let ((centre-of-array-x (floor (/ (first (array-dimensions diagram)) 2)))
- (centre-of-array-y (floor (/ (second (array-dimensions diagram)) 2))))
- (labels ((write-functor (x y char)
- (setf (aref diagram (- (first (array-dimensions diagram)) (+ x centre-of-array-x 1)) (+ y centre-of-array-y)) char))
- (select-character (args default)
- (if force-char force-char (cond
- ((getf args :igui) "!")
- ((and (getf args :move)
- (not (getf args :capture))) "m")
- ((and (getf args :capture)
- (not (getf args :move))) "c")
- (t default)))))
- ;; (cond
- ;; ((getf args :range)
- ;; (cond ((= x y)
- ;; (if (eql (getf (getf args :range) :distance) :infinite)
- ;; (loop for i from (1+ centre-of-array-x) below
- (write-functor x y (select-character args "x"))
- diagram))))
Advertisement
Add Comment
Please, Sign In to add comment