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

Content added Content deleted
No edit summary
No edit summary
Line 47: Line 47:
console write:(CharValue new:(theArray@thePointer)).
console write:(CharValue new:(theArray@thePointer)).
]
]

#method run : aLoop
[
control while:[ 0 < (theArray@thePointer) ] &do: [ aLoop eval:self ].
]
#method get = theArray@thePointer.
#method get = theArray@thePointer.
}
}
Line 96: Line 101:
]
]
#method run
#method repeatUntil
[
[
theTape run: &&:aTape [ interpreter'Interpreter new:aTape eval:theLoopBody ].
control while:[0 < theTape get ] &do:
[ interpreter'Interpreter new:(theTape type'tape) eval:theLoopBody. ].
^ theTape.
^ theTape.
Line 136: Line 140:
"," ? [ theTape input. ]
"," ? [ theTape input. ]
"[" ? [ theTape := LoopInterpreter new &tape:theTape. ]
"[" ? [ theTape := LoopInterpreter new &tape:theTape. ]
"]" ? [ theTape := theTape run. ].
"]" ? [ theTape := theTape repeatUntil. ].
]
]
}
}