[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New successor function for project 2



Some folks pointed out that the successor function that was included
in the project 2 code I gave you to extend misses some children and
duplicates others. 

Here is a slightly modified version that seems to do correct
generation. Just replace the old function with this (I also updated
the code available from the project page so it now has this version).

If you have already completed the project 2 with the other version,
that is fine--just make a note on your submission

Rao

;;--------------------------------------
;;child generation...
(defun successors (n symbol)
    (do ((children nil (cons next children))
         (i 1 (+ 1 i))
	 ;;changed it back to 1 (and changed the end test below) [Oct 10, 2003]
         ;;used to be i from 1... Changed on [Oct 28, 2001]
         (next (replace-null 0 n (car n) symbol)
               (replace-null i n (car n) symbol)))
        ((or (equal next n) (> i 9)) children)))
                  ;;used to be 8, made it 9 so it won't miss children[Oct 10, 2003]
;;--------------------------------------