(in-package :screamer-user) (defun print-pm-inst (pmi) (dotimes (x 8 (values)) (dotimes (y 8) (if (zerop (logand pmi (aref +bitsquares+ x y))) (write-char #\O) (write-char #\*)) (write-char #\Space)) (write-char #\Newline)) (write-char #\Newline) (values)) (defun print-char-array (arr) (dotimes (x 8 (values)) (dotimes (y 8) (write-char (aref arr x y)) (write-char #\Space)) (write-char #\Newline)) (write-char #\Newline) (values)) (defun print-solution (list) (let ((arr (make-array '(8 8) :initial-element #\O))) (mapcar #'(lambda (inst char) (dotimes (x 8) (dotimes (y 8) (when (intersect? inst (aref +bitsquares+ x y)) (setf (aref arr x y) char))))) list '(#\@ #\# #\$ #\% #\^ #\& #\* #\< #\: #\> #\? #\" #\~ #\!)) (print list) (write-char #\newline) (print-char-array arr))) (defun test-side-variants (sv) "buggy version of gen-side-variants generated duplicate side variants. this is a function used to test the debugged version." (dodirections (dir) (when (not (= (length (gethash dir sv)) (length (remove-duplicates (gethash dir sv) :test 'equal)))) (format t "~&~A has problems ~%" dir)))) (defun leveled-format (level str &rest params) (format t "~&") (dotimes (x (* 4 level))(write-char #\space)) (apply #'format (cons t (cons str params))) (format t "~%")) ;; $Id: //info.ravenbrook.com/user/ndl/lisp/contest/entries/denis-mashkevich/debug.lisp#1 $