https://kotlinlang.org logo
n

nfrankel

11/05/2016, 12:44 PM
@orangy it’s for sure much clearer but the original question was about verbosity i’d reconcile your answer with the original form and take advantage of the ordering
Copy code
when {
    currentCellState == Alive && liveNeighbours in 2..3 -> Alive
    currentCellState == Alive -> Dead       
    liveNeighbours == 3 -> Alive
    else -> Dead 
}
👍 1