From 14e38ce378236cf54924b58396168c1e94f8e6b2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 25 Mar 2024 18:59:03 +0100 Subject: Improved samples by adding links to problems --- samples/rosetta/hailstone.bruijn | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 samples/rosetta/hailstone.bruijn (limited to 'samples/rosetta/hailstone.bruijn') diff --git a/samples/rosetta/hailstone.bruijn b/samples/rosetta/hailstone.bruijn deleted file mode 100644 index d98c235..0000000 --- a/samples/rosetta/hailstone.bruijn +++ /dev/null @@ -1,21 +0,0 @@ -:import std/Combinator . -:import std/List . -:import std/Math M -:import std/Number/Binary . - -# hailstone sequence using binary shifts -hailstone y [[(0 =? (+1b)) {}0 go]] - go 0 : (=²?0 (1 /²0) (1 (↑¹0 + 0))) - -# --- tests --- - -seq-27 hailstone (+27b) - -:test (∀seq-27) ((+112)) -:test (take (+4) seq-27) ((+27b) : ((+82b) : ((+41b) : {}(+124b)))) -:test (take (+4) <~>seq-27) ((+1b) : ((+2b) : ((+4b) : {}(+8b)))) - -all-below-100000 [0 : ∀(hailstone 0)] <$> seq - seq take (+99999) (iterate ++‣ (+1b)) - -main [head (max-by (M.compare ⋔ tail) all-below-100000)] -- cgit v1.2.3