;;; Initially set the input potentials
(defvar *input* (bdg::pbm2arr #p"input.pbm"))
(funcall *bunny* :set-potential *input*)
;;; Changing memories to reach different results
(defvar *n-images* 5)
(dolist (s (subseq *dir* 0 *n-images*))
(print s)(terpri)
(funcall *bunny* :push-memory (bdg::pbm2arr s)))
;;; Breadth first update until probably converged
;;; Pause after updates for y/n <ret> but don't use it
(defvar *last-count* '0)
(loop for n from 0
for out = (with-output-to-string (*standard-output*)
(funcall *bunny* :format-pot-mems t))
for new-count = (loop for ch across out summing (if (char= #\1 ch) 1 0))
do (print out)
do (format t "~r:~%" n)
do (format t "old: ~d new: ~d~%" *last-count* new-count)
do (funcall *bunny* :update t)
do (y-or-n-p "Are you not satisfied?")
do (print '(I dont care))
do (terpri)
while (not (equal *last-count* new-count))
do (setq *last-count* new-count))