Commit d4e97b55 authored by Kento HASEGAWA's avatar Kento HASEGAWA

Support for multi-group problems at hsgw-solver

parent 62d5f661
Subproject commit 5e5c48717d206c28cf08e7295c19b8a22346a7c5
Subproject commit f2e4e6c80ba0d717151dbbe38e99f69691658e2f
from .data import Problem
from .data import Problem, Solution
......@@ -80,8 +80,12 @@ class Problem(object):
problem_text = ''
num_tiles = 0
line_remap_list = list()
line_remap_list.append(0)
block_remap_list = list()
block_remap_list.append(0)
block_text = ''
for bi, bn in enumerate(g):
block_remap_list.append(bn)
b = self.blocks[bn]
num_tiles += b['num_tiles']
......@@ -93,7 +97,7 @@ class Problem(object):
if isinstance(bc, int) and bc > 0:
if not bc in line_remap_list:
line_remap_list.append(bc)
remapped_index = line_remap_list.index(bc) + 1
remapped_index = line_remap_list.index(bc)
br_cells.append(str(remapped_index))
else:
br_cells.append(str(bc))
......@@ -106,7 +110,7 @@ class Problem(object):
problem_text += '\n'
problem_text += block_text
group_problems.append(problem_text)
group_problems.append((problem_text, line_remap_list, block_remap_list))
return group_problems
......@@ -348,7 +352,7 @@ class Solution(object):
self._id = str(uuid.uuid4())
self._parse_solution()
def _parse_solution(self):
if self.status != 'done':
......
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