misc: starting Turing Machine in Racket.

This commit is contained in:
Kyle Isom 2018-04-07 12:55:27 -07:00
parent 05a88c1a29
commit b6e24b44ad
1 changed files with 18 additions and 0 deletions

18
misc/turing.rkt Normal file
View File

@ -0,0 +1,18 @@
#lang racket
;;; a turing machine implementation
(define tape (make-hash))
(define (lookup position)
(unless (hash-has-key? tape position)
(hash-set! tape position 0))
(hash-ref tape position))
(define turing-machine%
(class object%
(init)
(define tape (make-hash))
(define head 0)
(define current-state #f)
(define state-table)
(super-new)))