// This is a simple iterative solution to a puzzle. It illustrates Frink's // "multifor" loop and permutation algorithms, and bailing out of loops with // labeled targets. // // Puzzle definition: // https://twitter.com/snegopa/status/980067722628337665 count = 0 x = new range[1, 9] NUMS: multifor nums = [x, x, x, x] { for order = nums.lexicographicPermute[] { n = parseInt[join["", order]] if n mod 12 != 0 next NUMS } count = count + 1 println[join["", nums]] } println["Solution is $count"]