Enhancement: Add one line string to 136/34 array in file tile.py.
@staticmethod
def one_line_string_to_136_array(string=None, has_aka_dora=False):
"""
Method to convert one line string tiles format to the 136 array, like
"123s456p789m11222z". 's' stands for sou, 'p' stands for pin,
'm' stands for man and 'z' or 'h' stands for honor.
You can pass r or 0 instead of 5 for it to become a red five from
that suit. To prevent old usage without red,
has_aka_dora has to be True for this to do that.
We need it to increase readability of our tests
"""
sou = ""
pin = ""
man = ""
honors = ""
split_start = 0
for index, i in enumerate(string):
if i == 'm':
man += string[split_start: index]
split_start = index + 1
if i == 'p':
pin += string[split_start: index]
split_start = index + 1
if i == 's':
sou += string[split_start: index]
split_start = index + 1
if i == 'z' or i == 'h':
honors += string[split_start: index]
split_start = index + 1
return TilesConverter.string_to_136_array(sou, pin, man, honors, has_aka_dora)
@staticmethod
def one_line_string_to_34_array(string=None):
"""
Method to convert one line string tiles format to the 34 array
We need it to increase readability of our tests
"""
results = TilesConverter.one_line_string_to_136_array(string)
results = TilesConverter.to_34_array(results)
return results
Enhancement: Add one line string to 136/34 array in file
tile.py
.Sincerely Illava.