Merge remote-tracking branch 'origin/master'

This commit is contained in:
2018-11-25 22:17:38 -05:00

View File

@@ -295,6 +295,7 @@ class B93Interpreter : Interpreter {
'&', '~' -> input(car) '&', '~' -> input(car)
'@' -> terminate() '@' -> terminate()
in '0'..'9' -> pushDig(car) in '0'..'9' -> pushDig(car)
' ' -> true
else -> noOp() else -> noOp()
} }
} }
@@ -319,9 +320,14 @@ class B93Interpreter : Interpreter {
if (processed) { if (processed) {
stepIP() stepIP()
if (ip.mode != IpMode.String) { 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() stepIP()
} }
if (numsteps == maxsteps) {
ip.mode = IpMode.Inactive
}
} }
val newIP = ip.copy() val newIP = ip.copy()
ipChanged(IpEvent(currIP, newIP)) ipChanged(IpEvent(currIP, newIP))