-
-
Save ko1nksm/63656db220e17734f2bec1e3a75c34df to your computer and use it in GitHub Desktop.
Revisions
-
ko1nksm revised this gist
Feb 3, 2023 . 1 changed file with 9 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 @@ -4,13 +4,18 @@ xs=80 ys=35 ORIGIN=$(clear) LF=' ' xorshift32=$(date +%s) xorshift32() { set -- "$1" "$xorshift32" set -- "$1" $(( $2 ^ (($2 << 13) & 0xFFFFFFFF) )) set -- "$1" $(( $2 ^ ($2 >> 17) )) set -- "$1" $(( $2 ^ (($2 << 5) & 0xFFFFFFFF) )) export $1=$(( (xorshift32 = $2) > 0 ? $2 : -1 * $2)) } j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do xorshift32 r export c$i$j=$((r%2)) i=$((i-1)) done; j=$((j-1)) -
ko1nksm revised this gist
Feb 3, 2023 . 1 changed file with 10 additions and 11 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 @@ -1,15 +1,16 @@ #!/bin/sh xs=80 ys=35 ORIGIN=$(clear) LF=' ' if [ ! ${RANDOM} ]; then set -- $(head -c $((xs * ys)) /dev/random | od -An -vtu1) fi j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do if [ ${RANDOM} ]; then r=${RANDOM}; else r=$1; shift; fi export c$i$j=$((r%2)) i=$((i-1)) done; j=$((j-1)) @@ -29,11 +30,11 @@ while true; do j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do t=0 for l in -1 0 1; do for k in -1 0 1; do tx=$(((i+k)%xs)); case $tx in -1) tx=$((tx+xs)) ;; esac ty=$(((j+l)%ys)); case $ty in -1) ty=$((ty+ys)) ;; esac t0=$((c$tx$ty)); t=$((t+t0)) case $k in 0) case $l in 0) t=$((t-t0)) ;; esac ;; esac done done @@ -50,6 +51,4 @@ while true; do export c$i$j=$((cn$i$j)) i=$((i-1)) done; j=$((j-1)) done done -
ko1nksm revised this gist
Feb 2, 2023 . 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 @@ -4,7 +4,7 @@ xs=80 ys=35 ORIGIN=$(tput cup 0 0) LF=' ' set -- $(head -c $((xs * ys)) /dev/random | od -An -vtu1) j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do -
ko1nksm revised this gist
Feb 2, 2023 . 1 changed file with 11 additions and 5 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 @@ -1,24 +1,30 @@ #!/bin/sh xs=80 ys=35 ORIGIN=$(tput cup 0 0) LF=' ' set -- $(dd if=/dev/urandom bs=$((xs * ys)) count=1 2>/dev/null | od -An -vtu1) j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do r=$1 shift export c$i$j=$((r%2)) i=$((i-1)) done; j=$((j-1)) done clear while true; do buf=$ORIGIN j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do case $((c$i$j)) in 1) buf="$buf*" ;; *) buf="$buf " ;; esac i=$((i-1)) done; buf="$buf$LF" j=$((j-1)) done echo "${buf%$LF}" j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do -
TAKIZAWA Yozo revised this gist
Feb 2, 2023 . 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 @@ -11,15 +11,15 @@ j=$ys; while [ $j != 0 ]; do done; j=$((j-1)) done while true; do clear j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do case $((c$i$j)) in 1) printf '*' ;; *) printf ' ' ;; esac i=$((i-1)) done; echo; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do t=0 @@ -38,12 +38,12 @@ while [ 1 ]; do i=$((i-1)) done; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do export c$i$j=$((cn$i$j)) i=$((i-1)) done; j=$((j-1)) done sleep 0.05 done -
TAKIZAWA Yozo revised this gist
Feb 1, 2023 . 1 changed file with 6 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 @@ -19,14 +19,15 @@ while [ 1 ]; do i=$((i-1)) done; echo; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do t=0 for k in -1 0 1; do for l in -1 0 1; do tx=$(((i+l)%xs)); case $tx in -1) tx=$((tx+xs)) ;; esac ty=$(((j+k)%ys)); case $ty in -1) ty=$((ty+ys)) ;; esac t0=$((c$((tx))$((ty)))); t=$((t+t0)) case $k in 0) case $l in 0) t=$((t-t0)) ;; esac ;; esac done done @@ -37,11 +38,12 @@ while [ 1 ]; do i=$((i-1)) done; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do export c$i$j=$((cn$i$j)) i=$((i-1)) done; j=$((j-1)) done sleep 0.05 done -
TAKIZAWA Yozo revised this gist
Feb 1, 2023 . 1 changed file with 3 additions and 6 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,12 +3,10 @@ xs=80 ys=35 j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do r=$(dd if=/dev/random bs=1 count=1 2> /dev/null) r=$(printf "%d" \'$r) export c$i$j=$((r%2)) i=$((i-1)) done; j=$((j-1)) done @@ -39,7 +37,6 @@ while [ 1 ]; do i=$((i-1)) done; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do export c$i$j=$((cn$i$j)) i=$((i-1)) -
TAKIZAWA Yozo revised this gist
Feb 1, 2023 . 1 changed file with 6 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,10 +3,12 @@ xs=80 ys=35 j=$ys; while [ $j != 0 ]; do r=$(dd if=/dev/random bs=$xs count=1 2> /dev/null) i=$xs; while [ $i != 0 ]; do r0=${r%${r#?}} r0=$(printf "%d" \'$r0 2> /dev/null) export c$i$j=$((r0%2)) r=${r#?} i=$((i-1)) done; j=$((j-1)) done @@ -44,5 +46,5 @@ while [ 1 ]; do done; j=$((j-1)) done sleep 0.05 done -
TAKIZAWA Yozo revised this gist
Feb 1, 2023 . 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 @@ -44,5 +44,5 @@ while [ 1 ]; do done; j=$((j-1)) done sleep 0.1 done -
TAKIZAWA Yozo revised this gist
Feb 1, 2023 . No changes.There are no files selected for viewing
-
TAKIZAWA Yozo created this gist
Feb 1, 2023 .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,48 @@ #!/bin/sh xs=80 ys=35 j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do r=$(dd if=/dev/random bs=1 count=1 2> /dev/null) r=$(printf "%d" \'$r) export c$i$j=$((r%2)) i=$((i-1)) done; j=$((j-1)) done while [ 1 ]; do clear j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do case $((c$i$j)) in 1) printf '*' ;; *) printf ' ' ;; esac i=$((i-1)) done; echo; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do t=0 for k in -1 0 1; do for l in -1 0 1; do t0=$((c$(((i+l)%xs))$(((j+k)%ys)))) t=$((t+t0)) case $k in 0) case $l in 0) t=$((t-t0)) ;; esac ;; esac done done case $((c$i$j)) in 1) case $t in 2|3) export cn$i$j=1 ;; *) export cn$i$j=0 ;; esac ;; *) case $t in 3) export cn$i$j=1 ;; *) export cn$i$j=0 ;; esac ;; esac i=$((i-1)) done; j=$((j-1)) done j=$ys; while [ $j != 0 ]; do i=$xs; while [ $i != 0 ]; do export c$i$j=$((cn$i$j)) i=$((i-1)) done; j=$((j-1)) done sleep 0.1 done