Join us on Discord!
You can help CodeWalrus stay online by donating here.

The Recamán Sequence (Code Golf)

Started by Yuki, June 15, 2018, 01:55:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yuki

The Recamán Sequence is probably one of the most fascinating sequences in maths. It looks good, it sounds good too. Full explanation in the video below.



The image featured in this video in particular, it looks pretty cool so I reproduced it in about 335 277 274 bytes.

Code (svg) Select
<svg xmlns="http://www.w3.org/2000/svg"><path id="p" stroke="#000" fill="none"/><script>/*<![CDATA[*/q=[];a="M2,325";for(s=i=0;i<65;)c=s-++i<=0||!!~q.indexOf(s-i),q.push(s+=j=i*c*2-i),a+="a1,1 0 0,"+(i%2^c)+" "+j+"0,0";document.all[1].setAttribute("d",a)//]]></script></svg>




Can you do better?
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

_iPhoenix_

Your code does not work for me (latest version of chrome, Mac); what browser are you using?
  • Calculators owned: Two TI-84+ CE's
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

Yuki

I use Vivaldi for Mac. So pretty much the same as you. And it works for me... weird. What did you do?
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Powered by EzPortal