Now time to make sudoku
This commit is contained in:
13
sudoku.lispbm
Normal file
13
sudoku.lispbm
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
(define nums '(1 2 3 4 5 6 7 8 9))
|
||||||
|
|
||||||
|
(define valid
|
||||||
|
(lambda (x)
|
||||||
|
(foldr
|
||||||
|
(lambda (y z)
|
||||||
|
(match (filter (lambda (q) (= q y)) nums)
|
||||||
|
(((? r) . nil) (match (filter (lambda (q) (= r q)) x)
|
||||||
|
(((? _)) z)
|
||||||
|
(_ nil)))
|
||||||
|
(_ nil)))
|
||||||
|
t
|
||||||
|
x)))
|
||||||
10
test.lispbm
10
test.lispbm
@ -1,10 +0,0 @@
|
|||||||
(defun fac (x)
|
|
||||||
(match x
|
|
||||||
(0 1)
|
|
||||||
(1 1)
|
|
||||||
(_ (* x (fac (- x 1))))))
|
|
||||||
|
|
||||||
(defun mymap (f m)
|
|
||||||
(if (eq m nil)
|
|
||||||
nil
|
|
||||||
(cons (f (car m)) (mymap m f))))
|
|
||||||
Reference in New Issue
Block a user