Follow

p=3.14;for i in $( seq 0 0.04 100 );do r=$( printf "128+127*s($i)\n" |bc -l |cut -d. -f1) g=$( printf "128+127*s($i+$p*(1/3))\n" |bc -l |cut -d. -f1 ) b=$( printf "128+127*s($i+$p*(2/3))\n" |bc -l |cut -d. -f1 ); printf "\e[48;2;$r;$g;${b}m\n"; done # Sunrise in a 24-bit terminal

@climagic Copy-paste a random piece of code I don't understand and execute it on my computer? I'm in!

Result was disappointing though:

Runtime error (func=(main), adr=21): Parameter number mismatch
Runtime error (func=(main), adr=34): Parameter number mismatch
Runtime error (func=(main), adr=36): Parameter number mismatch

@Sekun That gave me something. Still no sunrise though. Just a blank terminal.

@climagic stick a sleep 0.01; in there to get it to slow down some on a modern machine.

p=3.14;for i in $( seq 0 0.04 100 );do r=$( printf "128+127*s($i)\n" |bc -l |cut -d. -f1n" |bc -l |cut -d. -f1) g=$( printf "128+127*s($i+$p*(1/3))\n" |bc -l |cut -d. -f1 n" |bc -l |cut -d. -f1 ) b=$( printf "128+127*s($i+$p*(2/3))\n" |bc -l |cut -d. -f1 n" |bc -l |cut -d. -f1 ); printf "\e[48;2;$r;$g;${b}me[48;2;$r;$g;${b}m\n"; sleep 0.01; done

n"; sleep 0.01; done

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!