From 8b4b5107bc40aa8e4d5dfece7b582494c7cde068 Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Mon, 24 Oct 2022 23:04:53 -0700 Subject: Ruin my poor disk --- entries/braxtonhall/wc/fib.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 entries/braxtonhall/wc/fib.sh (limited to 'entries/braxtonhall/wc/fib.sh') diff --git a/entries/braxtonhall/wc/fib.sh b/entries/braxtonhall/wc/fib.sh new file mode 100644 index 0000000..c909617 --- /dev/null +++ b/entries/braxtonhall/wc/fib.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +rec () { + shopt -s nullglob dotglob + + if [ $2 == "0" ]; then + : + elif [ $2 == "1" ]; then + echo "🥵" > "$1/$2.fib" + else + mkdir "$1/$2" + rec "$1/$2" $(($2 - 1)) + rec "$1/$2" $(($2 - 2)) + fi +} + +rec $(pwd) $1 +find $(pwd)/$1 -type f | wc -l -- cgit v1.2.3-70-g09d2