summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-24 04:35:56 -0500
committerseth <[email protected]>2023-12-24 05:18:20 -0500
commit908736c29b1f20cf51a240c73f2a6f505ff50ed3 (patch)
tree7eec6c228e799266e4b490e287b24e616854bba8
parent0cd2567a1a19240b4338f081433900e9bc10fa32 (diff)
remove misc
-rw-r--r--misc/README.md3
-rw-r--r--misc/fizzbuzz.nix27
2 files changed, 0 insertions, 30 deletions
diff --git a/misc/README.md b/misc/README.md
deleted file mode 100644
index df99a17..0000000
--- a/misc/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# misc expressions
-
-these are standalone nix files for random things i do
diff --git a/misc/fizzbuzz.nix b/misc/fizzbuzz.nix
deleted file mode 100644
index 8306bd1..0000000
--- a/misc/fizzbuzz.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-max: let
- inherit (builtins) concatStringsSep filter isString map toString;
-
- mod = num: denom: num / denom * denom == num;
-
- results = {
- "15" = "fizzbuzz";
- "3" = "fizz";
- "5" = "buzz";
- };
-
- fizzbuzz = num: let
- a = filter isString (map (d:
- if mod num d
- then results.${toString d}
- else d) [15 3 5]);
- in
- if a == []
- then toString num
- else builtins.elemAt a 0;
-
- generate = i: max:
- if i == max
- then ["${fizzbuzz i}\n"]
- else [(fizzbuzz i)] ++ (generate (i + 1) max);
-in
- concatStringsSep "\n" (generate 1 max)