DEV Community

Cover image for Day-23 I Built a Colorful Random Number Guessing Game with JavaScript!
Tamilselvan K
Tamilselvan K

Posted on

Day-23 I Built a Colorful Random Number Guessing Game with JavaScript!

Hi Devs! πŸ‘‹
I'm excited to share my first mini project β€” a Random Number Game built using HTML, CSS, and JavaScript. It's a simple yet fun way to strengthen your JavaScript basics like Math.random() and Math.floor().


🧠 How the Game Works

The game generates a random number between 1 and 10.

You get 10 chances to guess it right.

Each wrong guess reduces your score by 1.

If you guess right, you win!

If your score reaches 0, it's Game Over.


πŸš€ Live Demo

πŸ‘‰ Play the Game Here(https://tamilselvan1812.github.io/15_RandomNumberGame/)


πŸ§‘β€πŸ’» Code on GitHub

πŸ“‚ View the Code on GitHub(https://github.com/Tamilselvan1812)


πŸ–₯️ Tech Stack Used

βœ… HTML5

🎨 CSS3 (with gradient animations)

βš™οΈ JavaScript (Math.random, DOM manipulation, event handling)


πŸ“Œ What I Learned

DOM Manipulation

Basic Input Handling

Styling UI with gradients and animations

Using Math.random() and Math.floor() to generate random numbers

Improving user experience with alert and game logic


Thanks for reading! If you liked this game, leave a ❀️ and follow me for more beginner-friendly projects!


Top comments (11)

Collapse
 
nevodavid profile image
Nevo David

honestly pretty cool seeing you grind out these mini projects like this - you think small daily projects make you learn faster or is it more about just sticking with it no matter what?

Collapse
 
tamilselvan1812 profile image
Tamilselvan K

Thanks, I really appreciate that! I think doing small daily projects helps a lot with learning because you're constantly applying what you know and picking up new things as you go. But honestly, consistency is probably the bigger pieceβ€”just showing up every day and building something, even if it's small, makes a big difference over time.

Collapse
 
ekalkutin profile image
Evgenii Kalkutin

you're bot. stop posting automated comments LOL

Collapse
 
parag_nandy_roy profile image
Parag Nandy Roy

Great job! A fun way to practice JS..

Collapse
 
tamilselvan1812 profile image
Tamilselvan K

Thank you mate!

Collapse
 
dotallio profile image
Dotallio

Love the colorful gradients and smooth UI on this! Are you planning to add any new features like difficulty levels or scoreboards?

Collapse
 
tamilselvan1812 profile image
Tamilselvan K

Thank you so much! Really glad you liked the gradients and UI β€” that means a lot. 😊
Yes, I'm actually considering adding features like difficulty levels and a scoreboard in upcoming updates. Always open to suggestions, so feel free to share any ideas you think would make it even better!

Collapse
 
shruti_saraswat_c258d5934 profile image
Shruti Saraswat

That's really cool project to start with!!

Collapse
 
tamilselvan1812 profile image
Tamilselvan K

Thank you! I really appreciate the kind words. It’s been a fun project to work on, and I’m excited to keep building and improving it!

Collapse
 
kurealnum profile image
Oscar

Great starter project!

Collapse
 
tamilselvan1812 profile image
Tamilselvan K

Appreciate it! Just trying to start small and build momentumβ€”glad it came across well.