aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/euler
diff options
context:
space:
mode:
Diffstat (limited to 'samples/euler')
-rw-r--r--samples/euler/009.bruijn2
-rw-r--r--samples/euler/013-input (renamed from samples/euler/013-input.bruijn)0
-rw-r--r--samples/euler/048.bruijn11
-rw-r--r--samples/euler/063.bruijn5
4 files changed, 17 insertions, 1 deletions
diff --git a/samples/euler/009.bruijn b/samples/euler/009.bruijn
index be21d9e..c789719 100644
--- a/samples/euler/009.bruijn
+++ b/samples/euler/009.bruijn
@@ -12,6 +12,6 @@ solve [head <#> lst] → head → tail
a 1 - 0
b (+2) ⋅ 3 ⋅ 2
c 1 + 0
- lst concat-map [map [check] ({ (+1) → --0 })] ({ (+2) → (sqrt 0) })
+ lst [[check] <$> ({ (+1) → --0 })] <++> ({ (+2) → (sqrt 0) })
main [solve (+1000)]
diff --git a/samples/euler/013-input.bruijn b/samples/euler/013-input
index 43b568e..43b568e 100644
--- a/samples/euler/013-input.bruijn
+++ b/samples/euler/013-input
diff --git a/samples/euler/048.bruijn b/samples/euler/048.bruijn
new file mode 100644
index 0000000..e4f2cbb
--- /dev/null
+++ b/samples/euler/048.bruijn
@@ -0,0 +1,11 @@
+# TODO: also very slow
+
+:import std/Combinator .
+:import std/String .
+:import std/Math .
+
+solve [∑ (+1) → 0 | [pow-mod 0 0 (+10000000000)]]
+
+:test ((solve (+10)) =? (+405071317)) ([[1]])
+
+main [solve (+1000)]
diff --git a/samples/euler/063.bruijn b/samples/euler/063.bruijn
new file mode 100644
index 0000000..eb54a65
--- /dev/null
+++ b/samples/euler/063.bruijn
@@ -0,0 +1,5 @@
+:import std/Combinator .
+:import std/Math .
+:import std/List .
+
+main [∑([y [[0 =? ++(log (+10) (2 ** 0)) (1 ++0) --0]] (+1)] <$> ({ (+1) → (+9) }))]