zucen.co
06/15/2018, 6:52 PMslots.fold(
0,
{i, slot ->
if(i>reps-1){
i // once it happened
} else
if(slot.card!=null){ // condition
i+1 // in row
}else{
0 // reset
}
}
) > rep-1
I do on very small sets but.. it is not obviously not very efficient.. would you recommend idiomatic yet effective way?