This is mainly a test to confirm that WordPress respects the pre tag such that I can post code snippets and that WordPress’ functionality works.
package fibonnaci;
object RecursiveFibonnaci {
// Fibonnacci using if/else. Note implicit return
def fib(n: int): int = {
if (n == 0) 0
else if (n == 1) 1
else fib(n-2) + fib(n-1)
};
}
That’s a simple example of the Fibonnaci function with
and
.
Tags: scala code LaTeX