【入門】Common Lisp その3【質問よろず】
■ このスレッドは過去ログ倉庫に格納されています
0029デフォルトの名無しさん
2007/06/13(水) 07:47:49それぞれ座標固定でいいの?
(defstruct maze size data)
(defun load-maze (file)
(with-open-file (stream file :direction :input)
(let ((size (read stream)))
(make-maze :size size
:data (make-array (list size size)
:initial-contents (loop for data = (read stream nil :eof) until (eq data :eof) collect data))))))
(defun print-maze (maze &aux (size (maze-size maze)))
(loop for row below size do
(loop for col below size do
(princ (if (eq (aref (maze-data maze) row col) 1) "+" " ")))
(terpri)))
■ このスレッドは過去ログ倉庫に格納されています