The bowling problem, but in scala!