lucy24 - 1:38 am on Feb 14, 2013 (gmt 0)
copyright, yes - but a patent?
A copyright would only protect the exact wording of the code. Put it in a different language, or rewrite the code, and the copyright is gone. If you want to cover the function, you'll need a patent.
A simple analogy is that you can't copyright a recipe; you can only copyright the exact wording you use in your cookbook. The recipe itself requires a patent-- and then, of course, you'd have to prove that nobody else ever though of mixing cream cheese and Dr Pepper.
Or, conversely: Sure you could copyright the working drawings for your invention. Faster and cheaper than a patent. But unless the thing is so phenomenally complicated that it can't possibly be built without the original plans, you haven't prevented anyone else from making the same thing.