Skip to content

Instantly share code, notes, and snippets.

@virusdave
Last active December 23, 2021 15:14
Show Gist options
  • Save virusdave/af7ba656d67499645e08959e6c08eb44 to your computer and use it in GitHub Desktop.
Save virusdave/af7ba656d67499645e08959e6c08eb44 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
XL=-2.0;XH=1;YL=-1;YH=1;MI=500;MC=7;X=$COLUMNS;Y=$LINES; for ((y=0;y<$Y;y++)); do for ((x=0;x<$X;x++)); do
R=$(echo "define g(){scale=10;v=x=((${XH}-(${XL}))*${x}/${X}+(${XL}));w=y=-((${YH}-(${YL}))*${y}/${Y}+(${YL}));for(i=1;i<${MI};i++){a=v*v-w*w+x;b=2*v*w+y;v=a;w=b;if(v*v+w*w>4){scale=0;return (${MC}-l(i)*(${MC}-1)/l(${MI}))};};return (0)}g()"|bc -l);echo -n -e "\e[4${R}m \e[0m";done;echo;done
@gubatron
Copy link

Left it running overnight, when I came back it had lots of black scan lines, resized the terminal window a few times and this is the best I could make it look on my 8k monitor with the smallest font size possible.
It seems $COLUMNS has a maximum value of 2048 in bash.

Screen Shot 2021-12-23 at 8 11 04 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment