Skip to content

ajaykumar413/Random-Number-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎲 JavaScript Random Number Generator

A simple and customizable random number generator built with JavaScript. This tool allows you to generate random numbers within a specified range, suitable for games, simulations, or simple number generation tasks.


🚀 Features

  • Generate a random number between a min and max value.
  • Lightweight and dependency-free.
  • Can be used in the browser or Node.js.
  • Easy to integrate and modify.

📦 Installation

You can clone the repository or simply copy the script into your project.

git clone https://github.com/ajaykumar413/random-number-generator-js.git

📜 Usage

In HTML/Browser

<script src="randomNumberGenerator.js"></script>
<script>
  const result = getRandomNumber(1, 100);
  console.log("Random Number:", result);
</script>

In Node.js

const { getRandomNumber } = require('./randomNumberGenerator');

console.log(getRandomNumber(10, 50)); // e.g., 27

📘 Example Function

Here’s a basic version of the function you might include:

function getRandomNumber(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

🛠️ Customization

  • Add support for floats.
  • Generate multiple numbers at once.
  • Add seed functionality (for deterministic results).

🧾 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙌 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.


📞 Contact

Created by [Ajay Kumar] – feel free to reach out via [ajayakumar7001@gmail.com].


Let me know if you'd like a version tailored for TypeScript, a GUI version (e.g. with HTML/CSS), or deployment instructions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published