Universal Turing machine: Difference between revisions

m
Line 2,395:
The simpler the better.
 
<lang lisp>(defun;; run (table input state halt blank)22.06.14
 
;; ask cyril.nocton:gmail.com
(defun run (table input state halt blank)
(let (l (r input) rule op exec)
(loop until (eql state halt) do
(setf rule (cdr (assoc state table)) op 'null execx t)
(dolist (symbol rule)
(case symbol
(= (setf execx (eql (car r) op)))
(% (when execx (rplaca r op)))
(< (when execx (push (pop l) r)))
(> (when execx (push (pop r) l)))
(@ (when execx (setf state op) (return)))
(t (setf op symbol)))
(unless (car r) (pop r) (push blank r))))
Line 2,432 ⟶ 2,433:
 
That's all Folks !
 
;;''cyril asknocton (cyril.nocton:@gmail.com''
 
=={{header|Cowgol}}==
422

edits