Last active
January 1, 2016 08:59
Revisions
-
eban revised this gist
Dec 25, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,13 +11,13 @@ HAT='^' tree() { h=$1 printf "\n%${h}s\e[33m${STAR}\n" m=$((h * 2 - 1)) eval set {1..$h} for l; do o=$((l * 2 - 2)) s=$(((m - o) / 2 + 1)) printf "%${s}s\e[32m${FSLASH}" for ((j=0; j < o; j++)); do or=${ORNAMENTS[${#ORNAMENTS[@]}*$RANDOM/32767]} oc=${ORNAMENT_COLORS[${#ORNAMENT_COLORS[@]}*$RANDOM/32767]} -
eban revised this gist
Dec 25, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ ORNAMENTS=(0069 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 2E1B 2042 2E2E 0026 0040 FF61) ORNAMENT_COLORS=(21 33 34 35 36 37) HAT='^' tree() { h=$1 -
eban revised this gist
Dec 25, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,11 +26,11 @@ tree() { printf "\e[32m${BSLASH}\n" done h1=$((h - 1)) spaces=$(printf "%*s" $h1) hats="\e[32m${spaces// /$HAT}" printf " ${hats}| |${hats}" if (($h > 10)); then printf "\n $spaces| |$spaces" fi printf "\n\n" } -
eban revised this gist
Dec 25, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ STAR=$' \u2605' FSLASH=$'\uFF0F' BSLASH=$'\uFF3C' ORNAMENTS=(0069 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 2E1B 2042 2E2E 0026 0040 FF61) ORNAMENT_COLORS=(21 33 34 35 36 37) HAT=$'\u005e' @@ -21,7 +21,7 @@ tree() { for ((j=0; j < o; j++)); do or=${ORNAMENTS[${#ORNAMENTS[@]}*$RANDOM/32767]} oc=${ORNAMENT_COLORS[${#ORNAMENT_COLORS[@]}*$RANDOM/32767]} printf "\e[${oc}m\u$or" done printf "\e[32m${BSLASH}\n" done -
eban revised this gist
Dec 25, 2013 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,23 +3,24 @@ STAR=$' \u2605' FSLASH=$'\uFF0F' BSLASH=$'\uFF3C' ORNAMENTS=(\\u0069 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u0020 \\u2E1B \\u2042 \\u2E2E \\u0026 \\u0040 \\uFF61) ORNAMENT_COLORS=(21 33 34 35 36 37) HAT=$'\u005e' tree() { h=$1 printf "\n%*s\e[33m${STAR}\n" $h "" m=$((h * 2 - 1)) eval set {1..$h} for l; do o=$((l * 2 - 2)) s=$(((m - o) / 2 + 1)) printf "%*s\e[32m${FSLASH}" $s "" for ((j=0; j < o; j++)); do or=${ORNAMENTS[${#ORNAMENTS[@]}*$RANDOM/32767]} oc=${ORNAMENT_COLORS[${#ORNAMENT_COLORS[@]}*$RANDOM/32767]} printf "\e[${oc}m$or" done printf "\e[32m${BSLASH}\n" -
eban created this gist
Dec 25, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ #!/bin/bash STAR=$' \u2605' FSLASH=$'\uFF0F' BSLASH=$'\uFF3C' ORNAMENTS="\u0069 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u0020 \u2E1B \u2042 \u2E2E \u0026 \u0040 \uFF61" ORNAMENT_COLORS="21 33 34 35 36 37" HAT=$'\u005e' tree() { h=$1 printf "\n%*s\e[33m${STAR}\n" $h "" m=$((h * 2 - 1)) for ((l=1; l <= h; l++)); do o=$((l * 2 - 2)) s=$(((m - o) / 2 + 1)) printf "%*s\e[32m${FSLASH}" $s "" for ((j=0; j < o; j++)); do or=$(shuf -n1 -e $ORNAMENTS) oc=$(shuf -n1 -e $ORNAMENT_COLORS) printf "\e[${oc}m$or" done printf "\e[32m${BSLASH}\n" done h1=$((h - 1)) hat=$(printf "%*s" $h1) hats="\e[32m${hat// /$HAT}" printf " ${hats}| |${hats}" if (($h > 10)); then printf "\n %*s| |%*s" $h1 "" $h1 "" fi printf "\n\n" } tree 20