Pong implementation in Scala