A Scala implementation of Cubic (Four in a Row with three dimensions)