Programmatic adventures in the hyperbolic plane
Recursion is dangerous. So dangerous that in my professional life I’m explicitly banned from using it in code. After all who would want their aeroplane to stall, their car to crash or their fridge to defrost because of a stack overflow. But it is also, most (but not all) programmers would agree, beautiful and more…
Who has been given the cash changing problem?
Some class, somewhere, has obviously been given the recursive money changing problem as a piece of work, because I have had several hundred visits in the last week from people seeking to get a grip on it. Here’s the best solution, either buy Structure and Interpretation of Computer Programs or simply read it for free online.…
The recursive cash changing algorithm
This is another one from Structure and Interpretation of Computer Programs which is a great book, but not a particularly easy read (not least because Scheme, the language in which the programs in the book is written is just different from C/Java etc). This example annoyed me for some time so I am writing down…