Brainbench perl test?
Dave Cross
dave at dave.org.uk
Tue Sep 4 14:17:40 BST 2012
Quoting Mr I <cub4ucme at gmail.com>:
> Consider the example I gave. How will you approach that? I bet you'd
> approach completely differently if you KNEW vedic mathematics.
Your example said:
"write a function ved(n, m) that implements the 16 sutras* and uses
them to return the result"
That's not a usable specification. The original question was:
"Given that fib(n) is equal to fib(n-1) + fib(n-2) write a fib
function in any language"
Can you not see the difference? It doesn't matter that it's a
well-known mathematical sequence. The required behaviour has been
specified in the question. It could be rewritten as:
"Given that blarg(n) is equal to blarg(n-1) + blarg(n-2) write a blarg
function in any language"
And it would still be solvable. Your question isn't a specification.
It can't be solved without guesswork.
And besides, I don't think I'd really want to work with a programmer
who didn't know what the Fibonacci sequence is :-)
Cheers,
Dave...
--
Perl School - http://perlschool.co.uk/
More information about the london.pm
mailing list