counting similiarities between strelka2.0 and fruit2.1

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Tony

Re: Starting from scratch

Post by Tony »

Uri Blass wrote:I simply did not consider searching for important information about it.
:lol:

If you were one of my programmers, I would kick you out.

Tony
Harald Johnsen

Re: Starting from scratch

Post by Harald Johnsen »

bob wrote: Why don't you do what I did? Pick up a manual and find out how to check the time, or (in unix) to use the select() system call to check for input available, or to use malloc() to allocate memory, or to use fork() to create a new process, or to use open() to create a new file or access an old one. Etc.???
Perhaps it's a matter of time or interest.
I can say that - for me - those low level things have absolutly no interest.
I don't even care about the winboard or uci protocol, this is some low level coding, you do it once and never look back.
The search, the eval, the heuristics, this is what a chess engine is about, those things *are* interesting (in this context).

When you copy those low level functions you can spare a lot of time because you know that the code will work. OTOH some of those low level function found is some source are so outdated that it's only luck if they still work. How many ppl now that the usual get_system_time() used in so many engines returns an overflowed number and that they compute their delta time by subtracting two overflowed numbers ?

HJ.
User avatar
xsadar
Posts: 147
Joined: Wed Jun 06, 2007 10:01 am
Location: United States
Full name: Mike Leany

Re: Starting from scratch

Post by xsadar »

Harald Johnsen wrote:
bob wrote: Why don't you do what I did? Pick up a manual and find out how to check the time, or (in unix) to use the select() system call to check for input available, or to use malloc() to allocate memory, or to use fork() to create a new process, or to use open() to create a new file or access an old one. Etc.???
Perhaps it's a matter of time or interest.
I can say that - for me - those low level things have absolutly no interest.
I don't even care about the winboard or uci protocol, this is some low level coding, you do it once and never look back.
The search, the eval, the heuristics, this is what a chess engine is about, those things *are* interesting (in this context).

When you copy those low level functions you can spare a lot of time because you know that the code will work. OTOH some of those low level function found is some source are so outdated that it's only luck if they still work.
You seem to contradict yourself here. Either you know they will work, or you don't. Personally, I'm more confident that those things will work (properly and with my code) if I write them myself.
How many ppl now that the usual get_system_time() used in so many engines returns an overflowed number and that they compute their delta time by subtracting two overflowed numbers ?

HJ.
I don't know anything about get_system_time(), but as long as it doesn't overflow twice in the time period you're measuring, then the subtraction will still give you the elapsed time. You only get into trouble when you expect time t+x to be greater than time t when it's not due to an overflow.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Starting from scratch

Post by michiguel »

tvrzsky wrote:I just second that. My guides when i started writing a chess program about eight years ago was a very informative book Chess on PC by Chessbase's Frederic Friedel and Dieter Steinwender and then primers on C programming which I had many :-).
Yet I had to learn and figure lot of things by myself (note that I am neither programmer nor scientist or engineer) and surely I was "reinventing the wheel" most of the time but I do not regret it. I remember the certain feel of proudness (please take it with humour) when I realized that MY system of storing the board is also well known as 0x88 (for example). So it is a matter of choice, you can use somebody's source and have strong engine virtually for nothing from which you can launch or spend hundreds and maybe thousands hours of hard work only to end with perhaps just mediocre one but YOUR OWN one. However it is definitely possible to do it without making any copy/past things.
Filip
I third that.

I started a decade ago in my little spare time with the goal of learning C (I do not have a formal training in computer science, but I always loved to program in pascal). It helped a lot to read comp.lang.c often. It takes a while, but it is possible to write an engine from absolute zero. I figured rotated bitboards by myself. I read bob saying he was using "rotated bitboards" and immediately got the idea from just those two words. Implementing it had the pleasure of building a big puzzle. That's how I started. Most likely it was not a good idea to start with that, but if your goal is to have fun, it certainly was rewarding.

In the process, I learned a lot about comp. sci. It is my hobby. Why would I want to copy code? that would be like peeking a dictionary when you do crossword puzzles. I am not criticizing who do that, but it depends what your goals are.

Now I handle C with confidence and I use it in many of my scientific projects in biochemistry. It pays to learn.

Miguel