Skip to main content
added 23 characters in body
Source Link
flawr
  • 43.9k
  • 7
  • 104
  • 249

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

There is also this beauty that does not need function files. Unfortunately it is a little bit longer:

g=@i=@(gp,c)@c{2-p}();g=@(g,f,x)i(f(x)==x,{@()x,@()g(g)(,f,y)}{2-(y=ff(x)==x)});q=@(f,x);gg(g,f,x)

Try it online!

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

There is also this beauty that does not need function files. Unfortunately it is a little bit longer:

g=@(g)@(f,x){@()x,@()g(g)(f,y)}{2-(y=f(x)==x)}();g(g)

Try it online!

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

There is also this beauty that does not need function files. Unfortunately it is a little bit longer:

i=@(p,c)c{2-p}();g=@(g,f,x)i(f(x)==x,{@()x,@()g(g,f,f(x))});q=@(f,x)g(g,f,x)

Try it online!

added 306 characters in body
Source Link
flawr
  • 43.9k
  • 7
  • 104
  • 249

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

There is also this beauty that does not need function files. Unfortunately it is a little bit longer:

g=@(g)@(f,x){@()x,@()g(g)(f,y)}{2-(y=f(x)==x)}();g(g)

Try it online!

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

Try it online!

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

There is also this beauty that does not need function files. Unfortunately it is a little bit longer:

g=@(g)@(f,x){@()x,@()g(g)(f,y)}{2-(y=f(x)==x)}();g(g)

Try it online!

deleted 7 characters in body
Source Link
flawr
  • 43.9k
  • 7
  • 104
  • 249

OctaveMATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

Try it online!

Octave, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

Try it online!

MATLAB, 41 bytes

function x=g(f,x);while f(x)-x;x=f(x);end

Try it online!

Source Link
flawr
  • 43.9k
  • 7
  • 104
  • 249
Loading