Skip to main content
Commonmark migration
Source Link

#GolfScript - 45 38 36 characters#

GolfScript - 45 38 36 characters

###Medium-force dirty implementation recurrence relation (38 36 characters):###

Medium-force dirty implementation recurrence relation (38 36 characters):

n%{~{.2$*{\(.2$f\2$(f+*}{=}if}:f~p}/

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

Light-force series solution (45 characters):

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

#GolfScript - 45 38 36 characters#

###Medium-force dirty implementation recurrence relation (38 36 characters):###

n%{~{.2$*{\(.2$f\2$(f+*}{=}if}:f~p}/

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

GolfScript - 45 38 36 characters

Medium-force dirty implementation recurrence relation (38 36 characters):

n%{~{.2$*{\(.2$f\2$(f+*}{=}if}:f~p}/

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

Light-force series solution (45 characters):

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/
added 38 characters in body
Source Link
aaaaaaaaaaaa
  • 4.4k
  • 1
  • 16
  • 24

#GolfScript - 45 3838 36 characters#

###Medium-force dirty implementation recurrence relation (3838 36 characters):###

~]2/{.0&{~=}n%{~{.@2$*{\([\].f\)2$f\2$(+f+*f+*}{=}if}:f%n*f~p}/

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

#GolfScript - 45 38 characters#

###Medium-force dirty implementation recurrence relation (38 characters):###

~]2/{.0&{~=}{~.@([\].f\)(+f+*}if}:f%n*

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

#GolfScript - 45 38 36 characters#

###Medium-force dirty implementation recurrence relation (38 36 characters):###

n%{~{.2$*{\(.2$f\2$(f+*}{=}if}:f~p}/

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/
added 580 characters in body
Source Link
aaaaaaaaaaaa
  • 4.4k
  • 1
  • 16
  • 24

#GolfScript - 4545 38 characters#

###Medium-force dirty implementation recurrence relation (38 characters):###

~]2/{.0&{~=}{~.@([\].f\)(+f+*}if}:f%n*

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

Light-force series solution.

#GolfScript - 45 characters#

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/

Light-force series solution.

#GolfScript - 45 38 characters#

###Medium-force dirty implementation recurrence relation (38 characters):###

~]2/{.0&{~=}{~.@([\].f\)(+f+*}if}:f%n*

The recurrence relation I stole from Peter Taylors solution, it goes like this:

f(x, y) = y * ( f(x-1, y) + f(x-1, y-1) )

With special cases if either variable is 0.

My implementation does not reuse previous results, so each function call branch to two new calls, unless one of the zero cases have been reached. This give a worst case of 2^21-1 function calls which takes 30 seconds on my machine.

###Light-force series solution (45 characters):###

n%{~.),0\{.4$?3$,@[>.,,]{1\{)*}/}//*\-}/p;;}/
Source Link
aaaaaaaaaaaa
  • 4.4k
  • 1
  • 16
  • 24
Loading