Skip to content

Instantly share code, notes, and snippets.

@kevinrobayna
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinrobayna/c2a0970bcf5395efdd24 to your computer and use it in GitHub Desktop.
Save kevinrobayna/c2a0970bcf5395efdd24 to your computer and use it in GitHub Desktop.
function times( x, y ) {
if ( x == 0 || y == 0 ) {
return z ( x );
}
else if ( y == 1 ) {
var g = function ( x ) {
return p ( arguments, 0 );
};
return g ( x );
}
else if ( y > 1 ) {
y --;
var h = function ( x, y, times_x_y ) {
return p ( arguments, 2 );
};
return add ( x, h ( x, y, times ( x, y ) ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment