SabakiHQ / Sabaki

An elegant Go board and SGF editor for a more civilized age.
https://sabaki.yichuanshen.de/
MIT License
2.39k stars 376 forks source link

Why is Sabaki unable to connect to my custom engine #922

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi, I have a very simple engine written in Javascript as shown here:

function gtp() {
    while(true) {
        console.log('=\n')
    }
}
gtp()

Can someone help me understand why this doesn't work?

I have a very similar Python script but that one worked.

def gtp():
    while True:
        print('=\n')
gtp()
apetresc commented 1 year ago

I have no clue, but the fact that the Python one works is pretty solid indication that this isn't a Sabaki issue. Probably just something about console.log not properly piping to stdin, or not flushing the buffer, or something along those lines. I suggest trying to debug by having another program connect to your "engine" via a pipe and see if the Python and JS versions behave identically (they probably don't).