Created
October 13, 2022 11:21
-
-
Save andresgcarmona/7baba9ac9c02c3fab91376fb12180196 to your computer and use it in GitHub Desktop.
Mandelbrot coffee
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 characters
m=(x,y)-> | |
a=x | |
b=y | |
z=0 | |
for i in [0..99] | |
(return if i>60 then '*' else if i>10 then '-' else if i>5 then '.' else ' ') if z>4 | |
l=y*y | |
z=x*x+l | |
y=2*x*y+b | |
x=x*x-l+a | |
'@' | |
console.log (m x,y for x in [-1.5..0.5] by 2/79).join '' for y in [-1.3..1.3] by 2.6/40 |
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 characters
n='\u001b[0m' | |
m=(x,y)-> | |
a=x | |
b=y | |
z=0 | |
for i in [0..999] | |
(return if i>100 then '\u001b[33m*'+n else if i>10 then '\u001b[34m-'+n else if i>5 then '\u001b[31m.'+n else ' ') if z>4 | |
l=y*y | |
z=x*x+l | |
y=2*x*y+b | |
x=x*x-l+a | |
'\u001b[32m@\u001b[0m' | |
console.log (m x,y for x in [-1.5..0.5] by 2/79).join '' for y in [-1.3..1.3] by 2.6/40 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment