remove .swp

This commit is contained in:
rtz19970824 2017-11-28 15:04:00 +08:00
parent 17a22138f7
commit 2f95a1d854
7 changed files with 21 additions and 35 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
leela-zero
*.pyc
parameters
*.swp

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,6 +8,7 @@
from game import Game
import utils
class GTPEngine():
def __init__(self, **kwargs):
self.size = 19
@ -27,7 +28,6 @@ class GTPEngine():
except:
self._version = 2
self.disconnect = False
self.known_commands = [
@ -42,9 +42,6 @@ class GTPEngine():
x, y = vertex
return "{}{}".format("ABCDEFGHJKLMNOPQRSTYVWYZ"[x - 1], y)
def _vertex_string2point(self, s):
if s is None:
return False
@ -62,7 +59,6 @@ class GTPEngine():
return False
return (x, y)
def _parse_color(self, color):
if color.lower() in ["b", "black"]:
color = utils.BLACK
@ -72,7 +68,6 @@ class GTPEngine():
color = None
return color
def _parse_move(self, move_string):
color, move = move_string.split(" ", 1)
color = self._parse_color(color)
@ -84,8 +79,6 @@ class GTPEngine():
else:
return False
def _parse_res(self, res, id_=None, success=True):
if success:
if id_:
@ -98,7 +91,6 @@ class GTPEngine():
else:
return '? {}\n\n'.format(res)
def _parse_cmd(self, message):
try:
m = message.strip().split(" ", 1)
@ -130,8 +122,6 @@ class GTPEngine():
else:
return self._parse_res("unknown command", id_, False)
def cmd_protocol_version(self, args, **kwargs):
return 2, True
@ -172,7 +162,6 @@ class GTPEngine():
except ValueError:
raise ValueError("syntax error")
def cmd_play(self, args, **kwargs):
move = self._parse_move(args)
if move:
@ -191,7 +180,3 @@ class GTPEngine():
return self._vertex_point2string(move), True
else:
return 'unknown player', False

Binary file not shown.

Binary file not shown.