Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:24:43+00:00 2026-05-29T13:24:43+00:00

I am currently in the process of coding a points system for a website

  • 0

I am currently in the process of coding a points system for a website I maintain, and with that I would like to award my users a random amount of points daily.

This is what I am thinking

[0-25] has a 75% chance 
[26 - 51] has a 13% chance
[52 - 76] has a 6% chance
[77 - 115] has a 4% chance
[115 - 200 ] has a mere 2% chance

So, the point bracket 0-25 has the 75% chance of being generated, so is most likely to be the one that is made.

If anyone has any ideas, or suggestions, it would be awesome to hear them.

So, basically I want a random number generated, 1-200 and I want 0-25 to have a much higher chance that 115-200.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:24:44+00:00Added an answer on May 29, 2026 at 1:24 pm

    First generate a random number between 0 and 99. Then generate a second random number in the range picked by the first.

    $ranges = Array(
        Array(0,25,75), // [0-25] on 75% chance
        Array(26,51,13),
        Array(52,76,6),
        Array(77,115,4),
        Array(115,200,2)
    );
    $sel = rand(0,99);
    do {
        $pick = array_shift($ranges);
        $sel -= $pick[2];
    } while($pick && $sel >= 0);
    $random = rand($pick[0],$pick[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are currently going through the long process of writing some coding standards for
I am currently in the process of making a new ASP.net MVC website, and
I am currently in the process of searching for a rules engine that works
I'm currently in the process of writing an application that has quite a number
I am currently in the process of designing myself a database driven website. The
I'm currently in the process of coding a summary report in Access XP for
We've got a process currently which causes ASP.NET websites to be redeployed. The code
We currently have a process where we receive an inventory file from a vendor
I'm currently in the process of setting up a continuous integration environment at work.
I am currently in the process of creating my own blog and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.