Skip to content

Instantly share code, notes, and snippets.

@tomaes
Last active August 29, 2015 14:01
Show Gist options
  • Save tomaes/ac99067cfb907ea182c6 to your computer and use it in GitHub Desktop.
Save tomaes/ac99067cfb907ea182c6 to your computer and use it in GitHub Desktop.
old'n'dirty PETSCII fractal experiment. ;)
12 s = 2^10+40*3: w = 40: h = 20: mi = 10: co = 108: ti$="000000": print"{clear}"
20 fory=-1to1step.1: forx=-3to1step.1
45 xn = 0: yn = 0: i = 0
47 if (xn*xn+yn*yn)<4 then if (i<mi) then t=(xn*xn)-(yn*yn)+x: yn=2*x*y+y: xn=t: i=i+1: goto47
49 px=(x+3.)/4*w: py=(y+1.)/2*h
50 poke s + py*w + px, co+((i+x+y)and127)
58 print"{home}t:"ti$", x:"str$(px)", y:"str$(py)", i:"str$(i)"{space*9}"
60 next x,y:poke198,.:wait198,1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment