To me, an "original" engine is an engine you wrote yourself.benstoker wrote:Well, well, well. You have really done it now. Hyatt put his imprimatur on my best attempt to express a keep-it-simple-stupid guideline for writing an "original" engine, and you come in and blow it all up. I give up. I am convinced now that I will never know or understand whatever the heck it takes to write an "original" chess engine. Because as soon as one expert agrees on a set of criteria, another expert is always there to not just disagree, but completely diagree. If there exists this thing called an "original" engine, I will not know it if it stands before me, I will just take it to be a kind of ascription of "beauty", and that therefore "originality" is in the eye of the beholder.Bo Persson wrote:No.benstoker wrote:Is this correct, then?hyatt wrote:one-input -> one-output is pretty clear and well-defined. The minute you reach one-input -> multiple possible outputs, you cross the line. But not before, IMHO. Note that this is a suggestion. NO one has adopted it as a rule or policy...
1) If one-input-one-output function, then source code of this function can be copy/pasted into an original engine.
2) If one-input-MULTIPLE-possible-outputs function, then source code of this function cannot be copy/pasted into an original engine.
Source code is text, and is copyrighted just like books and newspaper articles, and web pages. You can't copy that without permission.
However, and I think that's what Bob is hinting at, for a small, well defined function it is very hard to PROVE that you copied it (unless you also copy all the comments verbatim). To be a bit cynical, what is legal is actually what you get away with. Innocent until proven guilty!
For these small code snippets, we have the additional quirk that a disassembled version of my MemberCount function will look exactly like the "disassembled" version of Crafty's asm code. We can all see that it is not because I copied the code from Crafty, but because I, Bob, and the MS compiler writers have all read about the bit twiddling techniques Gerd linked to. Even the compiler understands the intention, and generates the correct code!
In this case it is hard to accuse anybody of stealing the technique, because "everybody" knows about it already.
So, if you have one small function that is identical, it is legal because of the "get away with it" rule. If your have hundreds of identical functions, you will be in more trouble!
![Wink ;)](./images/smilies/icon_e_wink.gif)
It will of course be based on ideas also used by others. Usually your set of ideas will be slightly different from mine, or from Bob's. The originality lies in actually implementing some ideas in your own way, to see how it works out. Perhaps you can find a new combination that works better than what others have done? Or implement it in a smarter way? That's the fun for me.
I have previously used examples from my BitBoard class (using C++ and templates, instead of ugly C macros) that I wrote after seeing what Bob had done. That's where the MemberCount function comes from. After realizing what Bob did, but without looking too closely at his code, I coded up my implementation on my own. I thought it was obvious to use 0, 45, 90, and 135 degrees for the rotations, so that is what I have. Only several years later did I notice that Bob rotated his boards 0, 90, and +/- 45 degrees. Works either way!
So now we have totally different implementations of the same idea. Using an idea, but not copying code.
As we have seen earlier, it is possible that two implementations of a small function can result in the same machine code, by chance. There could be more functions like that in a program, maybe two, maybe five. What cannot happen by chance is that every function is the same, doing exactly the same things on exactly the same data structures.
So what happens if the similarities are not for five functions, and not for all of the program? Six? Perhaps. Twelve? Well... Hundred and fourty seven identical functions. Definitely copied!