Skip to content

Dice roller #3198

Closed
vivek2004-sec wants to merge 5 commits into
geekcomputers:masterfrom
vivek2004-sec:dice
Closed

Dice roller #3198
vivek2004-sec wants to merge 5 commits into
geekcomputers:masterfrom
vivek2004-sec:dice

Conversation

@vivek2004-sec

Copy link
Copy Markdown
Contributor

Description

This PR adds a dice-rolling simulator feature to the project. It allows a user to specify how many dice they want to roll, then displays each rolled die as ASCII/box-drawing art (instead of plain numbers), first in a vertical layout (one die's art fully printed before the next) and then in a horizontal layout (dice printed side-by-side, row by row, mimicking a real dice throw on a table). Finally, it calculates and prints the total sum of all dice rolled.
The visual representation is built using a dice_art dictionary that maps each die face (1–6) to a 5-line tuple of strings drawn with box-drawing characters (┌, ─, │, └) and dot symbols (●) to represent pips, closely resembling a physical die face.
Problem it solves: Plain text output like [3, 5, 1] for dice rolls is unintuitive and unengaging. This feature makes dice rolls visually intuitive and more fun to read, which is especially useful for CLI-based board game tools, tabletop RPG utilities, or teaching demos involving loops/dictionaries.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code cleanup/refactoring

Related Issues

Closes #(issue number)

Testing

Please describe the tests you've run to verify your changes:

  • Manual testing
  • Added automated tests
  • Existing tests pass

Checklist

  • My code follows the project's code style
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the README.md if needed
  • My changes generate no new warnings
  • I have tested my code locally
  • New and existing tests pass with my changes

Screenshots (if applicable)

Add screenshots or demos of your changes if relevant.

@vivek2004-sec vivek2004-sec deleted the dice branch July 6, 2026 05:45
@vivek2004-sec vivek2004-sec mentioned this pull request Jul 6, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant