;; ;; ~/projects/games/mc/mc-test.cl --- ;; ;; $Id: mc-test.cl,v 1.4 2006/01/30 08:56:56 harley Exp $ ;; (in-package "MC") ;; (assert (= 1.5707964 (p-theta 0 0 100 0))) ;; -> right (assert (= 100.0 (p-dist 0 0 0 100))) (assert (= 0.0 (p-dist 0 100 0 100))) ;; (assert (blip-pos-x-< (make-blip :pos-x 0) (make-blip :pos-x 10))) (assert (not (blip-pos-x-< (make-blip :pos-x 0) (make-blip :pos-x 0)))) (assert (not (blip-pos-x-< (make-blip :pos-x 10) (make-blip :pos-x 0)))) (assert (not (blip-pos-x-< nil (make-blip :pos-x 10)) (assert (blip-pos-x-< (make-blip :pos-x 10) nil)) ;; (defun *test-vec* nil) (defun test-vec-sort () (let ((vec (make-array 10))) (dotimes (i 10) (setf (aref vec i) (make-blip :pos-x (- 100 i)))) (sort vec #'blip-pos-x-<) (setf *test-vec* vec))) ;; (test-vec-sort) ;; *test-vec* ;; (blips-in-circle *test-vec* 100 0 1)