Remove 'import java.util' from js tests.

This commit is contained in:
Ilya Gorbunov
2016-08-20 07:29:41 +03:00
parent 1eac6d47ed
commit 2aa60adbca
54 changed files with 12 additions and 73 deletions
@@ -7,7 +7,6 @@
* See this page for details:
* http://confluence.jetbrains.net/display/Kotlin/Type-safe+Groovy-style+builders
*/
import java.util.*
fun main(args: Array<String>) {
val result =
+4 -11
View File
@@ -3,9 +3,6 @@
* See http://en.wikipedia.org/wiki/Conway's_Game_of_Life
*/
import java.util.*
import java.util.Collections
/*
* A field where cells live. Effectively immutable
*/
@@ -123,16 +120,12 @@ fun printField(s: String, steps: Int) {
fun makeField(s: String): Field {
val lines: List<String> = s.split("\n")
val w = Collections.max<String>(lines.toList(), Comparator<String> { o1, o2 ->
val l1: Int = o1.length
val l2 = o2.length
l1 - l2
})!!
val data = Array(lines.size) { Array(w.length) { false } }
val w = lines.map { it.length }.max()!!
val data = Array(lines.size) { Array(w) { false } }
// workaround
for (i in data.indices) {
data[i] = Array(w.length) { false }
data[i] = Array(w) { false }
for (j in data[i].indices)
data[i][j] = false
}
@@ -144,5 +137,5 @@ fun makeField(s: String): Field {
}
}
return Field(w.length, lines.size) { i, j -> data[i][j] }
return Field(w, lines.size) { i, j -> data[i][j] }
}
@@ -18,7 +18,6 @@
* I want to get the prize, and this program helps me do so as soon
* as I possibly can by finding a shortest path through the maze.
*/
import java.util.*
/**
* This function looks for a path from max.start to maze.end through