我在Common Lisp工作,试图让Windows游戏扫雷.
我有一个列表,(1 1 1 2 2 2 3 3 3)并希望打印像矩阵
(1 1 1
2 2 2
3 3 3)
Run Code Online (Sandbox Code Playgroud)
怎么做?
编辑
我在开头
(format t "Input width:")
(setf width (read))
(format t "Input height:")
(setf height (read))
(format t "How many mines:")
(setf brMina (read))
(defun matrica (i j)
(cond ((= 0 i) '())
(t (append (vrsta j) (matrica (1- i) j) ))))
(setf minefield (matrica width height))
(defun stampaj ()
(format t "~%~a" minefield ))
Run Code Online (Sandbox Code Playgroud)