New answers tagged

2

In def addColumn you can extract bytes and then add them to put: val bytes = value match { case v: String => Bytes.toBytes(v) case v: Long => Bytes.toBytes(v) case v: Boolean => Bytes.toBytes(v) case v: Array[String] => Bytes.toBytes(v.mkString(",")) } put.addColumn(columnFamily, col, bytes) I'm not sure that Scala can check ...


4

you can remove main method and use extends App. It's safe 3 line of code. replace Array('1', '2', '3', '4', '5', '6', '7', '8', '9') on ('1' to '9').toArray I prefer always use type annotation if it is not clear. E.g.: val nextMove: Int = readMove(board) use Intellij autoformat (ctrl + alt + L) it is good idea to say user what is wrong with his input before ...


Top 50 recent answers are included