Thank you very much for testing!
I'll fix the problem with the next version.
Fridolin 2.0
Moderators: hgm, Rebel, chrisw
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Fridolin 2.0
For Visual Studio 15, you will also have to change the input test. The internal struct members for FILE * are no longer visible.
bool CConsole::isinput(void)
{
if (m_waiting)
return(true);
#if defined(IS_WINDOWS)
#if _MSC_VER < 1900
if (stdin->_cnt > 0)
return(true);
#endif
if (m_pipe)
{
DWORD dw = 0;
if (!PeekNamedPipe(m_stdin, NULL, 0, NULL, &dw, NULL))
return(true);
return(dw > 0);
}
else
{
return(0 != _kbhit());
}
#else
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 0;
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(STDIN_FILENO, &readfds);
select(STDIN_FILENO + 1, &readfds, NULL, NULL, &tv);
return FD_ISSET(STDIN_FILENO, &readfds);
#endif
}
bool CConsole::isinput(void)
{
if (m_waiting)
return(true);
#if defined(IS_WINDOWS)
#if _MSC_VER < 1900
if (stdin->_cnt > 0)
return(true);
#endif
if (m_pipe)
{
DWORD dw = 0;
if (!PeekNamedPipe(m_stdin, NULL, 0, NULL, &dw, NULL))
return(true);
return(dw > 0);
}
else
{
return(0 != _kbhit());
}
#else
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 0;
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(STDIN_FILENO, &readfds);
select(STDIN_FILENO + 1, &readfds, NULL, NULL, &tv);
return FD_ISSET(STDIN_FILENO, &readfds);
#endif
}
-
- Posts: 326
- Joined: Mon May 24, 2010 4:32 pm
Re: Fridolin 2.0
Thank you Christian for releasing your enginefridokar wrote:Thank you very much for testing!
I'll fix the problem with the next version.
-
- Posts: 326
- Joined: Mon May 24, 2010 4:32 pm
Re: Fridolin 2.0
Thanks Engin for reporting that releaseEngin wrote:Fridolin 2.0 Leiden that played in WCCC 2015 is for download here:
https://sites.google.com/site/fridolinchess/
would be interesting to include this engine in tournaments besides Maverick engine
-
- Posts: 31
- Joined: Sat Sep 24, 2016 4:13 am
- Location: Netherlands
- Full name: Roelof Berkepeis
Re: Fridolin 2.0
Lately I had the same problem, using Fridolin in a Linux GUI. I emailed the author of Fridolin and he pointed me to this forum post and this solution. I'm not a C programmer, but looking at the modified code I see this can not be right : just moving the #endif line like that is not valid because it interrupts the if-else statement .. i did not try that code, but i made my own version, which does (also) work :
Code: Select all
void CConsole::init(void)
{
m_waiting = true;
m_logging = false;
#if defined(IS_WINDOWS)
DWORD dw;
m_stdin = GetStdHandle(STD_INPUT_HANDLE);
m_pipe = !GetConsoleMode(m_stdin, &dw);
if (!m_pipe)
{
SetConsoleMode(m_stdin, dw &~ (ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT));
FlushConsoleInputBuffer(m_stdin);
}
else
{
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
}
#else
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
#endif
}
-simple is not always best but best is always simple-