Quinn
05/16/2019, 2:08 PMval origin = Source(1,1)
val source1 = Source(5,8)
val source2 = Source(3,4)
val source3 = Source(8,10)
var sources = arrayOf(source1, source2, source3)
class Source(x: Int, y: Int) {
val x: Int = x
val y: Int = y
}
for ( source in sources ) {
println("${source.x}, ${source.y}")
}
Seems like I need to pass sortWith a comparator.