Hi all,
I've looked at the search.cpp and the first line in the "think" method as this:
static Book book;
The Book object is only used in this method, and the Book class is not static as far as I could see. Why is it static in this context? I got the stockfish source to work in a Silverlight project Im working on but only by removing the static keyword as this was the only error I was getting. Removing this keyword seems to have not created any issues.
Thanks for any feedback on this.
David
Stockfish search function
Moderators: hgm, Rebel, chrisw
-
- Posts: 85
- Joined: Sun May 29, 2011 11:56 pm
- Location: San Diego
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Stockfish search function
See Book's constructor and you will realize that if you define the book object as a local variable, book moves will be deterministic instead of pseudo-random.whittenizer wrote:Hi all,
I've looked at the search.cpp and the first line in the "think" method as this:
static Book book;
The Book object is only used in this method, and the Book class is not static as far as I could see. Why is it static in this context? I got the stockfish source to work in a Silverlight project Im working on but only by removing the static keyword as this was the only error I was getting. Removing this keyword seems to have not created any issues.
Thanks for any feedback on this.
David
BTW defining book object as static id _not_ an error in C++.
-
- Posts: 85
- Joined: Sun May 29, 2011 11:56 pm
- Location: San Diego
Re: Stockfish search function
Ill have to look again then at the Book class. Thanks for your input.
-
- Posts: 85
- Joined: Sun May 29, 2011 11:56 pm
- Location: San Diego
Re: Stockfish search function
Hi, one thing just wnated to clear up, I didnt mean to say that in general having the Book class static is an error, I was only getting that error in the context of what I was doing.
Anyways, I'm not a C++ person at all. I know enough though to create this wrapper so I can use it in my Silverlight project. Anyways, I think I'm on a good path now, and do appreciate your reply.
Thanks again.
Anyways, I'm not a C++ person at all. I know enough though to create this wrapper so I can use it in my Silverlight project. Anyways, I think I'm on a good path now, and do appreciate your reply.
Thanks again.