Rubik solver in Scala