Random Plinko path using functional programming style
In Scala the if-else pattern is an expression, which means we can use it to return a value (similar to Java's or C++'s ternary operator). You don't have to change much in order to take advantage of this: 

def getPath(prevSlot: Double): Stream[Double] = {
  val left = 
    if (prevSlot &lt;= 0.0) false
    else if (prevSlot &gt;= 8.0) true
    else Random.nextBoolean

  if (left) prevSlot #:: getPath(prevSlot - 0.5)
  else prevSlot #:: getPath(prevSlot + 0.5)
}


And then of course you could get a readout of your path with the following:

getPath(4.0).take(13).toList.foreach(println)