|
|
|
|
|
by bridger
4419 days ago
|
|
When I was doing this exercise with a friend on Understudy, he found solutions to multiplication and exponentiation too. I'm still trying to wrap my head around the exponentiation. Passing a number to another number?! (define (multiply number1 number2)
(lambda (f)
(number1 (lambda (x) ((number2 f) x)))))
(define (exponentiate base exponent)
(exponent base))
|
|
If you look at the input and output of thrice, it looks like this:
What if we used the output as the input again? We have a name for what we just did to the "thrice" function, and that name is "twice". So that's (twice thrice), and we can see it makes something happen 3^2 = 9 times.