Moved puzzle generation from cases to functions.