diff options
Diffstat (limited to 'samples/euler/012.bruijn')
-rw-r--r-- | samples/euler/012.bruijn | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/samples/euler/012.bruijn b/samples/euler/012.bruijn new file mode 100644 index 0000000..e644a03 --- /dev/null +++ b/samples/euler/012.bruijn @@ -0,0 +1,12 @@ +# TODO: Find faster algorithm + +:import std/Combinator . +:import std/Math . + +factors [[y [[[(1 <? 3) (2 ++1 (0 + (=?(4 % 1) (+2) (+0)))) 0]]] (+1) (+0)] ++(sqrt 0)] + +solve [y [[[(factors 1) >? 3 1 (2 (1 + 0) ++0)]]] (+0) (+0)] + +:test ((solve (+5)) =? (+28)) ([[1]]) + +main [solve (+500)] |