Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
64
Task/Julia-set/Amazing-Hopper/julia-set-1.hopper
Normal file
64
Task/Julia-set/Amazing-Hopper/julia-set-1.hopper
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/hopper
|
||||
|
||||
#include <hopper.h>
|
||||
|
||||
main:
|
||||
|
||||
hxres = 500 // horizontal resolution
|
||||
hyres = 500 // vertical resolution
|
||||
|
||||
itermax = 100 // maximum iters to do
|
||||
|
||||
brk_out = 64 // |z|^2 greater than this is a breakout
|
||||
magnify = 1 // 10 is standard magnification, but if > 2, resolution should be greater than 500
|
||||
|
||||
cr = -0.8 // real part of c in z^2=z^2+c
|
||||
ci = 0.156 // imaginary part of c in z^2=z^2+c
|
||||
|
||||
julia=0,{hxres,hyres}nanarray(julia)
|
||||
|
||||
{","}toksep
|
||||
#hl{ // tag "high-level", Basic language embebed in Hopper
|
||||
|
||||
hy=1
|
||||
while(hy<=hyres)
|
||||
hx=1
|
||||
while(hx<=hxres)
|
||||
|
||||
y = 4*((((hyres+1-hy-0.5)/hyres)-0.5)/magnify)
|
||||
x = 4*((((hx-0.5)/hxres)-0.5)/magnify)
|
||||
zm = 0
|
||||
|
||||
iter=1
|
||||
|
||||
while(iter<=(itermax-1))
|
||||
xx = sqrdiff(x,y)+cr //(x*x)-(y*y)+cr
|
||||
y = (2.0*x*y)+ci
|
||||
x = xx
|
||||
zsq = sqradd(x,y) //(x*x)+(y*y)
|
||||
|
||||
if (zsq>zm)
|
||||
zm=zsq
|
||||
endif
|
||||
if (zsq>brk_out)
|
||||
break
|
||||
endif
|
||||
iter += 1
|
||||
wend
|
||||
|
||||
if (iter>=itermax)
|
||||
julia[hy,hx]=1
|
||||
|
||||
else
|
||||
julia[hy,hx]=0
|
||||
|
||||
endif
|
||||
|
||||
hx+=1
|
||||
wend
|
||||
hy+=1
|
||||
wend
|
||||
}
|
||||
toc(t1,t2)
|
||||
{julia,"julia.dat"}save
|
||||
exit(0)
|
||||
25
Task/Julia-set/Amazing-Hopper/julia-set-2.hopper
Normal file
25
Task/Julia-set/Amazing-Hopper/julia-set-2.hopper
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <jambo.h>
|
||||
|
||||
Main
|
||||
Set stack 15
|
||||
Cls
|
||||
map = {}
|
||||
Set '" ", ".", ":", "-", "=", "+", "*", "#", "%", "$", "@"', Apnd list 'map'
|
||||
|
||||
Loop for ( y= -1.0, Less equal (y,1.0), Let ( y:=Add(y,0.05)) )
|
||||
Loop for ( x= -1.5, Less equal (x,1.5), Let ( x:=Add(x,0.025)) )
|
||||
zr = x, zi = y, i = 0, br = 0
|
||||
Loop
|
||||
Let ( br := Sqr diff(zr,zi) Minus '0.8' )
|
||||
Let ( zi := Mul(Mul(zr, zi), 2), Plus '0.156' )
|
||||
zr = br
|
||||
Break if ( Greater ( Sqr add (zr, zi), 4 ) )
|
||||
++i
|
||||
While ( Less equal (i, 100) )
|
||||
Colorfore( Int div(i,11) Plus '91' )
|
||||
Print ( [ Intdiv(i,11) Plus(1)] Get 'map' )
|
||||
Next
|
||||
Prnl
|
||||
Next
|
||||
Prnl
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue