Skip to content

Commit 6f3b57a

Browse files
Bhunesh386Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f1cb57c commit 6f3b57a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

dice_roller.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ def main():
3636
rolls = [random.randint(1, 6) for _ in range(num_dice)]
3737

3838
print(f"\nRolling {num_dice} dice...")
39-
print("~" * (num_dice * 11))
4039

4140
# Retrieve ASCII art for each rolled die
4241
dice_arts = [get_die_art(val) for val in rolls]
4342

43+
separator = " "
44+
die_width = len(dice_arts[0][0])
45+
divider = "~" * (num_dice * die_width + (num_dice - 1) * len(separator))
46+
print(divider)
47+
4448
# Print dice side-by-side by iterating line by line (0 to 4)
4549
for line_index in range(5):
46-
row_line = " ".join(dice_art[line_index] for dice_art in dice_arts)
50+
row_line = separator.join(dice_art[line_index] for dice_art in dice_arts)
4751
print(row_line)
4852

49-
print("~" * (num_dice * 11))
53+
print(divider)
5054

5155
# Output results and total sum
5256
print(f"Individual Rolls: {rolls}")

0 commit comments

Comments
 (0)