-1
;; loads a board from the given file
;; it expects the board to be in the format of a single S-expression:
;; a list of nine lists, each containing 9 numbers
(defun get-board-from-file file
(let ((in (open file :if-does-not-exist nil)))
(when in (return-from get-board-from-file (read in)))
(when (not in) (format t "~%Unable to open file ~A" file))
)
)
這是一個數獨求解器解決方案的一部分。這段lisp代碼的球拍翻譯是什麼?
你在Racket上試過了什麼?您的翻譯中某些具體內容是否無效? –
我根本不認識球拍。我試圖通過Lisp代碼的小型翻譯來學習,我之前曾使用它。 – McFiddlyWiddly
歡迎來到StackOverflow!我們鼓勵你先給它一個裂縫,告訴我們你想出了什麼,然後我們可以幫助你克服你遇到的具體障礙。通常,人們不會簡單地翻譯代碼。 –