aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/rosetta/greatest_common_divisor.bruijn
diff options
context:
space:
mode:
Diffstat (limited to 'samples/rosetta/greatest_common_divisor.bruijn')
-rw-r--r--samples/rosetta/greatest_common_divisor.bruijn8
1 files changed, 8 insertions, 0 deletions
diff --git a/samples/rosetta/greatest_common_divisor.bruijn b/samples/rosetta/greatest_common_divisor.bruijn
new file mode 100644
index 0000000..37bbb66
--- /dev/null
+++ b/samples/rosetta/greatest_common_divisor.bruijn
@@ -0,0 +1,8 @@
+:import std/Combinator .
+:import std/Number .
+
+gcd y [[[=?0 1 (2 0 (1 % 0))]]]
+
+:test ((gcd (+2) (+4)) =? (+2)) ([[1]])
+:test ((gcd (+10) (+5)) =? (+5)) ([[1]])
+:test ((gcd (+3) (+8)) =? (+1)) ([[1]])