Fix code that starts on a space not running
This commit is contained in:
@@ -295,6 +295,7 @@ class B93Interpreter : Interpreter {
|
||||
'&', '~' -> input(car)
|
||||
'@' -> terminate()
|
||||
in '0'..'9' -> pushDig(car)
|
||||
' ' -> true
|
||||
else -> noOp()
|
||||
}
|
||||
}
|
||||
@@ -319,9 +320,14 @@ class B93Interpreter : Interpreter {
|
||||
if (processed) {
|
||||
stepIP()
|
||||
if (ip.mode != IpMode.String) {
|
||||
while (funge[ip.pos].asChar == ' ') {
|
||||
var numsteps = 0
|
||||
val maxsteps = if (funge.height > funge.width) funge.height else funge.width
|
||||
while (funge[ip.pos].asChar == ' ' && numsteps++ < maxsteps) {
|
||||
stepIP()
|
||||
}
|
||||
if (numsteps == maxsteps) {
|
||||
ip.mode = IpMode.Inactive
|
||||
}
|
||||
}
|
||||
val newIP = ip.copy()
|
||||
ipChanged(IpEvent(currIP, newIP))
|
||||
|
||||
Reference in New Issue
Block a user