2017-03-19から1日間の記事一覧

チューリングマシン

言語:Emacs Lisp (defun turing (input) (let ((tape (make-list 16 0)) (head '(0 0)) (prog nil)) (defun readhead () (elt tape (car head))) (defun writehead (x) (setf (elt tape (car head)) x)) (defun movehead (x) (if (equal x 'R) (setf (car he…