Tianshou/AlphaGo/test.py

40 lines
687 B
Python
Raw Normal View History

2017-11-20 12:44:29 +08:00
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# $File: test.py
# $Date: Fri Nov 17 13:5600 2017 +0800
# $Author: renyong15 © <mails.tsinghua.edu.cn>
#
from game import Game
from engine import GTPEngine
g = Game()
2017-11-26 13:36:52 +08:00
e = GTPEngine(game_obj=g)
2017-11-20 12:44:29 +08:00
res = e.run_cmd('1 protocol_version')
print(e.known_commands)
print(res)
res = e.run_cmd('2 name')
print(res)
res = e.run_cmd('3 known_command quit')
print(res)
res = e.run_cmd('4 unknown_command quitagain')
print(res)
res = e.run_cmd('5 list_commands')
print(res)
res = e.run_cmd('6 komi 6')
print(res)
res = e.run_cmd('7 play BLACK C3')
print(res)
res = e.run_cmd('8 genmove BLACK')
print(res)
2017-11-26 13:36:52 +08:00
res = e.run_cmd('9 genmove WHITE')
print(res)