Download or view jigglyNumberPuzzle.frink in plain text format
// 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"]
Download or view jigglyNumberPuzzle.frink in plain text format
This is a program written in the programming language Frink.
For more information, view the Frink
Documentation or see More Sample Frink Programs.
Alan Eliasen was born 20145 days, 7 hours, 26 minutes ago.