Random number generator web app

user profile photouser profile photouser profile photo3147 developers have joined this project.

What you will practice

You will practice using PHP with styling elements from HTML and CSS. You will learn how to generate random outputs, which can be applied to real-world projects such as a game system, raffle system, or even “quote of the day.”

Introduction

There are various use cases for a Random Number Generator. You could do a random dice roll or get a random quote. Most of the time, the implementation is relatively straightforward and similar to this project’s approach. In this project, we will create a dice roll simulation.

Requirements

The RNG should consist of:

  • An input box to assign how many dice to roll
  • A drop down box to select the sides of the dice (for example d4, d6, d8, d10, d12, d20)
  • A PHP rand(); function taking the inputs from the form
  • An output to show # of dice rolled, the type of dice (d4, d6 ..), the total count of the dices rolled
  • Output the details (number) of the individual dice rolls (Possibly using a foreach loop)

Suggested Implementation

PHP is a server-side language, which means we need to use either a local web server (Free) or a web hosting package (Low cost) to run the code.

  • The majority of the functionality will be passed with PHP, HTML will allow us to create the form and the webpage structure, and CSS will give us the ability to style the HTML.Server: Local web server such as XAMPP or WAMP OR Web hosting
  • Basic PHP knowledge of using variables and POST content.
  • Using simple PHP functions such as rand();
  • Basic knowledge of HTML/CSS to create forms

References

  • This project requires very few resources that are all freely available and easy to set up. (Such as WAMP!)
  • For anyone wishing to brush up on their design skills, you can use CSS to change the look of the form.
  • For those who use or want to understand Bootstrap, you can use the library for the elements you need.

Interested in this project?

Shorten your learning curve with on-demand programming help

The awesome set of verified mentors will provide guidance and mentoring help when you are stuck.

Suresh Atta

  • Post request free
  • First 15 mins free
Shorten your learning curve with on-demand programming help

Browse more projects

More coming soon...