Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with adding your own engine on Python #937

Open
ultralightbeat opened this issue May 28, 2023 · 2 comments
Open

Problem with adding your own engine on Python #937

ultralightbeat opened this issue May 28, 2023 · 2 comments

Comments

@ultralightbeat
Copy link

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
Copy link
Author

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

@ultralightbeat
Copy link
Author

`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()
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant