Jump to content

Execute Brain****/Elena: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 47:
console write:(CharValue new:(theArray@thePointer)).
]
 
#method run : aLoop
[
control while:[ 0 < theTape get(theArray@thePointer) ] &do: [ aLoop eval:self ].
]
#method get = theArray@thePointer.
}
Line 96 ⟶ 101:
]
#method runrepeatUntil
[
theTape run: &&:aTape [ interpreter'Interpreter new:(theTape type'tape)aTape eval:theLoopBody. ].
control while:[0 < theTape get ] &do:
[ interpreter'Interpreter new:(theTape type'tape) eval:theLoopBody. ].
^ theTape.
Line 136 ⟶ 140:
"," ? [ theTape input. ]
"[" ? [ theTape := LoopInterpreter new &tape:theTape. ]
"]" ? [ theTape := theTape runrepeatUntil. ].
]
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.