Not logged inRybka Chess Community Forum
Up Topic Rybka Support & Discussion / Rybka Discussion / How to Use Rybka Chess Engine with C++ or C#
- - By athena_1 [tr] Date 2016-04-14 04:39
Is there any sample which communicate rybka chess engine and C++ or C# code ?
Is it possible to run rybka chess engine with C++ or C# ?
Is there any sample ?
(So it may be possible to use it on custom GUI)
Parent - - By Labyrinth (*****) [us] Date 2016-04-14 11:15
What do you mean by 'sample'? Rybka is a closed source engine.

It is however a UCI engine, so it can be used with any GUI that supports UCI.
Parent - - By athena_1 [tr] Date 2016-04-14 14:57
I wonder how it is possible to communicate
with rybka chess engine and my own source
code in c# or c++ ?
So it will be possible to use it in specific GUI.
Try to find sample or tutorial for commination.
Parent - By Fulcrum2000 (****) [nl] Date 2016-04-14 17:27
You can communicate with the engine using the UCI protocol.
Parent - By cdani Date 2016-06-11 22:24
Some Visual Basic .net code, easy to change to C# to communicate with an engine using STDIN/OUT:

   Private Shared Output As StringBuilder = Nothing
    Dim sortStreamWriter As StreamWriter

Dim process = New Process()
        process.StartInfo.FileName = engine
        process.StartInfo.Arguments = ""
        process.StartInfo.UseShellExecute = False
        process.StartInfo.CreateNoWindow = True
        process.StartInfo.RedirectStandardInput = True
        process.StartInfo.RedirectStandardOutput = True

    Output = New StringBuilder()
        ' Set our event handler to asynchronously read the sort output.
        AddHandler process.OutputDataReceived, _
                   AddressOf SortOutputHandler

        ' Use a stream writer to synchronously write the sort input.
        sortStreamWriter = process.StandardInput

        ' Start the asynchronous read of the sort output stream.

'send something to engine
sortStreamWriter.WriteLine("position startpos moves " + something)

'read form the engine
                    s2 = Output.ToString
                Catch ex As Exception
                    'sometimes gives an exception
                End Try
                If IsNothing(s2) Then
                    Continue Do
                End If

Private Sub SortOutputHandler(sendingProcess As Object, _
         outLine As DataReceivedEventArgs)

        ' Collect the sort command output.
        If Not String.IsNullOrEmpty(outLine.Data) Then

            ' Add the text to the collected output.
            Output.Append(outLine.Data + Environment.NewLine)
        End If
    End Sub
Up Topic Rybka Support & Discussion / Rybka Discussion / How to Use Rybka Chess Engine with C++ or C#

Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill