7272def parse_input (input_string : str ) -> int :
7373 """Validate input string and return as an integer.
7474
75- Check if `input_string` is an integer number between MIN_DICE
76- and MAX_DICE. If so, return the integer value. Otherwise, raise
77- a ValueError.
75+ Check if `input_string` is an integer number between MIN_DICE and MAX_DICE.
76+ If so, return the integer value. Otherwise, raise a ValueError.
7877 """
7978 try :
8079 val = int (input_string .strip ())
@@ -87,8 +86,7 @@ def parse_input(input_string: str) -> int:
8786
8887
8988def roll_dice (num_dice : int ) -> List [int ]:
90- """Return a list of random integers between 1 and 6 with length
91- `num_dice`.
89+ """Return a list of random integers between 1 and 6 with length `num_dice`.
9290
9391 Args:
9492 num_dice: The number of dice to roll.
@@ -125,7 +123,7 @@ def generate_dice_faces_diagram(dice_values: List[int]) -> str:
125123 return dice_faces_diagram
126124
127125
128- def _get_dice_faces (dice_values : List [int ]) -> List [Tuple [str , str , str , str , str ]]:
126+ def _get_dice_faces (dice_values : List [int ]) -> List [Tuple [str , ... ]]:
129127 """Retrieve ASCII art representations for given dice values.
130128
131129 Args:
@@ -140,18 +138,16 @@ def _get_dice_faces(dice_values: List[int]) -> List[Tuple[str, str, str, str, st
140138 return dice_faces
141139
142140
143- def _generate_dice_faces_rows (
144- dice_faces : List [Tuple [str , str , str , str , str ]],
145- ) -> List [str ]:
141+ def _generate_dice_faces_rows (dice_faces : List [Tuple [str , ...]]) -> List [str ]:
146142 """Combine dice face tuples into horizontal rows of strings.
147143
148144 Args:
149- dice_faces: A list of tuples, where each tuple is the ASCII
150- art for a die.
145+ dice_faces: A list of tuples, where each tuple is the ASCII art for a
146+ die.
151147
152148 Returns:
153- A list of strings, each representing a horizontal row of the
154- dice diagram.
149+ A list of strings, each representing a horizontal row of the dice
150+ diagram.
155151 """
156152 dice_faces_rows = []
157153 for row_idx in range (DIE_HEIGHT ):
0 commit comments