Commit bfd3e10c authored by Kento HASEGAWA's avatar Kento HASEGAWA

Add support for a real solver in /solvers/

parent 604f39e7
### https://raw.github.com/github/gitignore/9d7ff09c7d38dce9ef03e7ea4dc908a622546757/Python.gitignore ### https://raw.github.com/github/gitignore/9d7ff09c7d38dce9ef03e7ea4dc908a622546757/Python.gitignore
# Project-specific files # Project-specific files
/conf.json /conf*.json
/problems/* /problems/*
!/problems/.gitkeep !/problems/.gitkeep
/solutions/* /solutions/*
......
...@@ -84,6 +84,7 @@ class Host(object): ...@@ -84,6 +84,7 @@ class Host(object):
if problem_key in self.problems: if problem_key in self.problems:
self.problems[problem_key].put_solution(solution) self.problems[problem_key].put_solution(solution)
print(solution['solution'])
return {'status': 'registered'} return {'status': 'registered'}
else: else:
return {'status': 'error'} return {'status': 'error'}
......
Subproject commit b306364dc696270165a9c67921720e4c6acf6866 Subproject commit 0098cc9c1932bd192f6a5fe066d9aea7960e5400
...@@ -11,6 +11,7 @@ class Problem(object): ...@@ -11,6 +11,7 @@ class Problem(object):
self.name = '' self.name = ''
self.size = (0, 0) self.size = (0, 0)
self.block_num = 0 self.block_num = 0
self.problem = ''
self.status = 'Ready' self.status = 'Ready'
self.solutions = dict() self.solutions = dict()
...@@ -23,6 +24,7 @@ class Problem(object): ...@@ -23,6 +24,7 @@ class Problem(object):
def _load_problem(self, path): def _load_problem(self, path):
with open(path, 'r') as fp: with open(path, 'r') as fp:
q_text = fp.read()
q_lines = fp.readlines() q_lines = fp.readlines()
board_size = [0, 0] board_size = [0, 0]
...@@ -40,6 +42,7 @@ class Problem(object): ...@@ -40,6 +42,7 @@ class Problem(object):
self.size = board_size self.size = board_size
self.block_num = block_num self.block_num = block_num
self.name = name self.name = name
self.problem = q_text
self.status = 'Ready' self.status = 'Ready'
def get_dict(self): def get_dict(self):
...@@ -48,6 +51,7 @@ class Problem(object): ...@@ -48,6 +51,7 @@ class Problem(object):
'size': self.size, 'size': self.size,
'size_str': self.size_str, 'size_str': self.size_str,
'block_num': self.block_num, 'block_num': self.block_num,
'problem': self.problem,
'status': self.status 'status': self.status
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment