Skip to content

shailawazeer/Dice-Roller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🎲 Dice Roller

A simple dice roller I built to practice JavaScript! Perfect for when you lose your dice during game night.

What it does

  • Roll 1-6 dice at once
  • Shows results as numbers and dice images
  • Clean interface that's easy to use

Built with

  • HTML for the structure
  • CSS for styling
  • Vanilla JavaScript for the fun stuff

How to use it

  1. Download the files
  2. Open index.html in your browser
  3. Pick how many dice you want (1-6)
  4. Hit "Roll Dice" and see what you get!

Make sure you have the dice images in a dice_images folder (1.png through 6.png).

How it works

Pretty straightforward - I use Math.random() to generate numbers 1-6, then show both the numbers and matching dice images. The main function grabs your input, rolls the dice, and updates the page.

Files you need

├── index.html          # The main page
├── diceroller.js       # Where the magic happens
├── s10.css            # Makes it look nice
└── dice_images/       # Your dice pictures

Want to change something?

Go for it! You could:

  • Add more dice types (D20 anyone?)
  • Make it look prettier
  • Add sound effects
  • Fix that typo where I wrote "numbers" instead of "number" 😅

That's it!

Simple project, but it was fun to build and actually useful. Sometimes the best way to learn is by making something you'd actually use.

Happy rolling! 🎲

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors