Edgars
12/11/2020, 8:44 AMephemient
12/11/2020, 11:23 AMEdgars
12/11/2020, 11:26 AMephemient
12/11/2020, 11:30 AMephemient
12/11/2020, 11:31 AMephemient
12/11/2020, 11:32 AMJakub Gwóźdź
12/11/2020, 11:37 AMNir
12/11/2020, 3:10 PMandyb
12/11/2020, 8:08 PMNir
12/11/2020, 8:17 PMJakub Gwóźdź
12/12/2020, 4:41 AMList<List<Char>>
to Set<Pair<Int,Int>>
to finally two alternating BooleanArray(rows*cols)
, but that also did not helped much
most improvement I got when testing if a set should be occupied changed from neighbours.count(::occupied)==0
to neighbours.none(::occupied)
🙂
but algorithmically - I didn't find any ways to optimise regular "for all sets, check neighbours"Nir
12/12/2020, 4:56 AMNir
12/12/2020, 4:57 AMNir
12/12/2020, 4:59 AMJakub Gwóźdź
12/12/2020, 5:00 AMval even = BooleanArray(rows * cols)
val odd = BooleanArray(rows * cols)
val counter = 0
while (...) {
val (src, dest) = if (count % 2 == 0) even to odd else odd to even
...