Skip to content

Instantly share code, notes, and snippets.

@tompng
Created August 4, 2019 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompng/4ee6c4019fc9796719fe419269efb2f4 to your computer and use it in GitHub Desktop.
Save tompng/4ee6c4019fc9796719fe419269efb2f4 to your computer and use it in GitHub Desktop.
haisai
def haisai(x,y)
y2=(y<0?y+2.75:y)
ha=((x+y-0.5)**2+4**(8*x+8*y-4)+(y-14*x-25-2*(x+y-0.5)**2)**2-6)*((6*x+4*y-x*x-1)**4+4*(y-x-2)**2-3)
ii=(16*(x-y2+7/8.0+x*x/8)**2+8*(y2-15/8.0)**4-1)*(49*(x-1)**2+32*(y2-1)**8-1)-1
sa=4/((x+1.25)**8+(16*y+16+(x+1.25)**2/4)**2/(1+(x+1.25)**2))+1/(4*(y+1)**8+(8*x+14)**2)+4/((y+4/3.0)**8+(16*x+12+(y+0.5)**4/2)**2)-1
ha*ii*sa
end
n=48
n.times{|y|
puts (2*n).times.map{|x|
'#." '[2.times.map{|z|haisai(2.6*(x-n)/n,2.6*(n-2*y-z)/n)<0?1<<z:0}.sum]
}.join
}
...
.. .#####
.###. .#####"
#####. .######"
###### .#######
.###### .. .#######"
####### ####. .#######"
.####### "##### .#########
####### ###### .############
######## ######. .##############
######## ######. ######"" ######
######## ######. """" ######
.######## ######. ######
########" ######. ######
.########" "##### ######
.#######"" "#### ######
.######"" "" ######
"""" ######
"####"
"##"
. ..
.### ###.
#### .#### .####
##### ##### ..#####
##### ##### .######
##### ##### .######"
.###### .###### .#######"
..#######################################.. .#######"
.########################################### #########
"##################"""""##################" .##########.
"###### "#####"" .#############.
"##### ##### .######"""######
##### ##### ###""" ######
##### .#### ######
#### ##### ######
"### ####" ######
" ##### ######
.#### ######
.####" ######
.#### ######
.###" ####
.##" ""
""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment