Fridolin 2.0

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

fridokar
Posts: 9
Joined: Thu Dec 04, 2014 2:14 pm

Re: Fridolin 2.0

Post by fridokar »

Thank you very much for testing!
I'll fix the problem with the next version.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Fridolin 2.0

Post by Dann Corbit »

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
}
Jamal Bubker
Posts: 326
Joined: Mon May 24, 2010 4:32 pm

Re: Fridolin 2.0

Post by Jamal Bubker »

fridokar wrote:Thank you very much for testing!
I'll fix the problem with the next version.
Thank you Christian for releasing your engine 8-)
Jamal Bubker
Posts: 326
Joined: Mon May 24, 2010 4:32 pm

Re: Fridolin 2.0

Post by Jamal Bubker »

Engin 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
Thanks Engin for reporting that release 8-)
User avatar
tissatussa
Posts: 31
Joined: Sat Sep 24, 2016 4:13 am
Location: Netherlands
Full name: Roelof Berkepeis

Re: Fridolin 2.0

Post by tissatussa »

abulmo wrote: Mon Aug 24, 2015 5:13 pm Under Linux, input & output are buffered.
I was able to make it work by modifying the function CConsole::init() in the file system.cpp. (...) so that the setvbuf() calls are also executed under Linux. (...)
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
}
Like this, the two setvbuf lines are also executed on Linux, but now in a proper way.
-simple is not always best but best is always simple-