我已经编写了这个打印出板子状态的函数,但最后,由于没有返回这个函数打印一个零!
功能:
(defun show-board (board)
(dotimes (number 8)
(dotimes (number2 8)
(let ((pos (aref board number number2)))
(cond
((equal pos 0) (format t "~a " "B"))
((equal pos 1) (format t "~a " "P"))
(t (format t "~a " "L")))))
(format t "~%")))
一块板是一个 8x8 阵列!
命令行上的函数调用输出:
B P B P B P B P
P B P B P B P B
B P B P B P B P
P B P B P B P B
B P B P B P B P
P B P B P B P B
B P B P B P B P
P B P B P B P B
NIL
我怎样才能摆脱NIL?