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

Problem with adding your own engine on Python #937

Open ultralightbeat opened 1 year ago

ultralightbeat commented 1 year ago

I watched a video(https://www.youtube.com/watch?v=gNHjeuQm7PA&list=PLmN0neTso3JzVlIQC3fwnP1qgIKp1x97X&index=6) where a guy had written his own python engine and decided to add it to Sabaki, but he can't initialize the version, name and so on

ultralightbeat commented 1 year ago

Go> name Connection Failed Go> version Connection Failed Go> protocol_version Connection Failed Go> list_commands Connection Failed

ultralightbeat commented 1 year ago

`def gtp():

main GTP loop

while True:
    # accept GUI command
    command = input()

    # handle commands
    if 'name' in command: print('= Wally\n')
    elif 'protocol_version' in command: print('= 1\n');
    elif 'version' in command: print('=', VERSION, '\n')
    elif 'list_commands' in command: print('= protocol_version\n')
    elif 'boardsize' in command: set_board_size(command); print('=\n')
    elif 'clear_board' in command: clear_board(); print('=\n')
    elif 'showboard' in command: print('= '); print_board()
    elif 'play' in command: play(command); print('=\n')
    elif 'genmove' in command: print('=', genmove(BLACK if command.split()[-1] == 'B' else WHITE) + '\n')
    elif 'quit' in command: sys.exit()
    else: print('=\n') # skip currently unsupported commands

start GTP communication

gtp() `