Revisions
-
ch604 revised this gist
Dec 20, 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 @@ -8,7 +8,7 @@ declare -A lastflakes clear move_flake() { i="$1" if [ "${snowflakes[$i]}" = "" ] || [ "${snowflakes[$i]}" = "$LINES" ]; then @@ -19,7 +19,7 @@ function move_flake() { fi fi printf "\033[%s;%sH\u274"$[($RANDOM%6)+3]"\033[1;1H" ${snowflakes[$i]} $i lastflakes[$i]=${snowflakes[$i]} snowflakes[$i]=$((${snowflakes[$i]}+1)) -
sontek renamed this gist
Dec 23, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
sontek revised this gist
Dec 21, 2011 . 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 @@ -15,11 +15,11 @@ function move_flake() { snowflakes[$i]=0 else if [ "${lastflakes[$i]}" != "" ]; then printf "\033[%s;%sH \033[1;1H " ${lastflakes[$i]} $i fi fi printf "\033[%s;%sH*\033[1;1H" ${snowflakes[$i]} $i lastflakes[$i]=${snowflakes[$i]} snowflakes[$i]=$((${snowflakes[$i]}+1)) -
sontek revised this gist
Dec 21, 2011 . 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 @@ -3,11 +3,11 @@ LINES=$(tput lines) COLUMNS=$(tput cols) declare -A snowflakes declare -A lastflakes clear function move_flake() { i="$1" -
sontek created this gist
Dec 21, 2011 .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,40 @@ #!/bin/bash LINES=$(tput lines) COLUMNS=$(tput cols) clear declare -A snowflakes declare -A lastflakes function move_flake() { i="$1" if [ "${snowflakes[$i]}" = "" ] || [ "${snowflakes[$i]}" = "$LINES" ]; then snowflakes[$i]=0 else if [ "${lastflakes[$i]}" != "" ]; then printf "\033[%s;%sH \033[0;0H " ${lastflakes[$i]} $i fi fi printf "\033[%s;%sH*\033[0;0H" ${snowflakes[$i]} $i lastflakes[$i]=${snowflakes[$i]} snowflakes[$i]=$((${snowflakes[$i]}+1)) } while : do i=$(($RANDOM % $COLUMNS)) move_flake $i for x in "${!lastflakes[@]}" do move_flake "$x" done sleep 0.1 done