I am still new to Scheme and trying to solve the magic squares via call/cc and the amb operator. Currently, it is printing out:
1 1 1 31 Row 1
16 16 1 1 Row 2
16 1 16 1 Row 3
1 16 16 1 Row 4
I can't figure out why it is only using those numbers. Is it my distinct? procedure? Here is my code:
;; check whether an element of one given list is a member of any
;; of the other given lists
(define distinct?
(lambda (o l)
(if (null? l)
#t
(if (= (car l) o)
'()
(distinct? o (cdr l))))))