move reset to abstract class
This commit is contained in:
@@ -24,11 +24,6 @@ class Interpreter93(stdinSrc: PipedWriter, stdoutDest: PipedReader)
|
||||
override val stdout: PipedWriter = PipedWriter(stdoutDest)
|
||||
|
||||
override val instructionSet = B93Instructions() + B93Extras()
|
||||
|
||||
override fun reset() {
|
||||
stdin.readAll()
|
||||
stdout.flush()
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import befide.befunge.core.state.Data
|
||||
import befide.befunge.core.state.MutableFunge
|
||||
import befide.befunge.core.state.MutablePointer
|
||||
import befide.befunge.core.util.Event
|
||||
import befide.befunge.core.util.readAll
|
||||
import java.util.*
|
||||
|
||||
abstract class MutableInterpreter<V, D : Data, M : Enum<M>>
|
||||
@@ -67,4 +68,9 @@ abstract class MutableInterpreter<V, D : Data, M : Enum<M>>
|
||||
notifyStack(StackOp.Push) { stack.push(datum) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun reset() {
|
||||
stdin.readAll()
|
||||
stdout.flush()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user