9 lines
211 B
WDTE
9 lines
211 B
WDTE
let str => 'strings';
|
|
|
|
let fib n => switch n {
|
|
< 0 => str.format 'Bad argument: {q}' n;
|
|
default => n -> (@ memo s n => switch n {
|
|
== 0 => 0; == 1 => 1;
|
|
default => + (s (- n 1)) (s (- n 2));
|
|
});
|
|
};
|