Nonogram solver in Scala