new accessors
parent
98c2548fa3
commit
754d68fb95
|
@ -1,6 +1,6 @@
|
||||||
IN: turing
|
|
||||||
USING: arrays assocs io kernel math namespaces
|
USING: arrays assocs io kernel math namespaces
|
||||||
prettyprint sequences strings vectors words ;
|
prettyprint sequences strings vectors words accessors ;
|
||||||
|
IN: turing
|
||||||
|
|
||||||
! A turing machine simulator.
|
! A turing machine simulator.
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ SYMBOL: tape
|
||||||
: turing-step ( -- )
|
: turing-step ( -- )
|
||||||
#! Do one step of the turing machine.
|
#! Do one step of the turing machine.
|
||||||
next-state
|
next-state
|
||||||
dup state-sym set-sym
|
dup sym>> set-sym
|
||||||
dup state-dir position [ + ] change
|
dup dir>> position [ + ] change
|
||||||
state-next state set ;
|
next>> state set ;
|
||||||
|
|
||||||
: c ( -- )
|
: c ( -- )
|
||||||
#! Print current turing machine state.
|
#! Print current turing machine state.
|
||||||
|
|
Loading…
Reference in New Issue