https://kotlinlang.org logo
#codereview
Title
# codereview
s

Shawn

01/19/2018, 5:00 PM
Copy code
if (!existCell.isEmpty()) {
  cell = when(existCell[existCell.size - 1]) {
    1 -> 9
    3 -> 7
    7 -> 3
    9 -> 1
    else -> 0  // or some default value
  }
}
👍 1
e

ebonet

01/22/2018, 1:32 PM
if (!existCell.isEmpty()) { val cellValue = existCell[existCell.size - 1] if ( cellValue%2==0 || cellValue==5) cell = 0 else cell 10- cellValue }
2 Views