First of all, let me say this is something I've wanted for a while, so good job and thank you to the author.
When I try the Tutorial.csx, I can't get this snippet to work:
static class MyMath
{
public static long Fibonacci(long n)
{
//anything more than 48 will result in a stack overflow.
if (n >= 48) throw new ArgumentException("Enter a number less than 48");
if (n == 0) return 0;
if (n == 1) return 1;
return Fibonacci(n - 1) + Fibonacci(n - 2);
}
}
// Now the method can be called like so:
MyMath.Fibonacci(12);
It gives me : "(14,0): error CS1525: Unexpected symbol `MyMath'" in the repl, anyone knows why?
When I try the Tutorial.csx, I can't get this snippet to work:
static class MyMath { public static long Fibonacci(long n) { //anything more than 48 will result in a stack overflow. if (n >= 48) throw new ArgumentException("Enter a number less than 48"); if (n == 0) return 0; if (n == 1) return 1; return Fibonacci(n - 1) + Fibonacci(n - 2); } }
// Now the method can be called like so: MyMath.Fibonacci(12);
It gives me : "(14,0): error CS1525: Unexpected symbol `MyMath'" in the repl, anyone knows why?