Skip to main content
removed LaTeX in preparation of disabling MathJax
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Ruby, 76 75 71 70 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\dd'[0,n+2]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

$$\varphi=1+\dots$$

f.call(3)
$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 71 70 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\dd'[0,n+2]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 71 70 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\dd'[0,n+2]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)
$$\varphi=1+\dots$$

f.call(3)
$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$
added 9 characters in body
Source Link
vvye
  • 261
  • 1
  • 6

Ruby, 76 75 7171 70 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+'d'[0,n]+'ots'+'}'*n+'$$$$\varphi=1+'+'\cfrac1{1+'*n+'\dd'[0,n+2]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 71 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+'d'[0,n]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 71 70 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\dd'[0,n+2]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

added 6 characters in body
Source Link
vvye
  • 261
  • 1
  • 6

Ruby, 76 7575 71 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+(n>0?'d':'')+'ots'+'}'*n+'$$$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+'d'[0,n]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+(n>0?'d':'')+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

Ruby, 76 75 71 bytes

This feels suspiciously straightforward, so please let me know if I messed up somewhere.

Incidentally, this is the first thing I've ever written in Ruby - I was looking for a language that supported string repetition by multiplying, and Ruby seemed to do the trick.

f=proc{|n|'$$\varphi=1+'+'\cfrac1{1+'*n+'\d'+'d'[0,n]+'ots'+'}'*n+'$$'}

To be applied like so:

f.call(0)

$$\varphi=1+\dots$$

f.call(3)

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$

saved 1 byte
Source Link
vvye
  • 261
  • 1
  • 6
Loading
Source Link
vvye
  • 261
  • 1
  • 6
Loading