fixed broken start-stop-rerun issue

This commit is contained in:
2018-11-25 22:52:28 -05:00
parent 4cc69a8dbd
commit 1eefc31cfe
5 changed files with 44 additions and 19 deletions

View File

@@ -14,6 +14,14 @@ class B93Funge : Funge {
private var cars = Array(height) { Array(width) { Value(' ') } }
override var values
get() = cars.map { it.toList() }
set(data) {
for (y in 0 until cars.size)
for (x in 0 until cars[y].size)
cars[y][x] = data[y][x]
}
override fun get(vec: Vec): Value {
return cars[vec.y][vec.x]
}

View File

@@ -12,6 +12,8 @@ interface Funge {
operator fun get(vec: Vec): Value
operator fun set(vec: Vec, value: Value)
var values: List<List<Value>>
/**
* Get the next position to be executed starting at [vec] and stepping by [delta]
*/