diff --git a/misc/turing.rkt b/misc/turing.rkt new file mode 100644 index 0000000..24013ad --- /dev/null +++ b/misc/turing.rkt @@ -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)))