d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Making A Ticket Wheel
Add Reply New Topic New Poll
Member
Posts: 3,076
Joined: Jul 14 2006
Gold: 3.69
Jan 29 2017 04:58pm
Currently trying to make a ticket wheel.
User enters how many tickets they want to.
User is assigned tickets based off what they entered.
Wheel spin around and stops on a player.
Ticket pot is added to user who wins.

What is the best way to code this to a private site
Im new so user-friendly please.

This post was edited by im_the_jew on Jan 29 2017 04:58pm
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Jan 30 2017 05:54am
So you want to make a website that hosts a multi-user raffle?

If you don't mind not actually displaying a wheel then this could be accomplished easily with a database of users/tickets and a random number generator.
Member
Posts: 3,076
Joined: Jul 14 2006
Gold: 3.69
Jan 30 2017 09:35am
Quote (Mastersam93 @ Jan 30 2017 03:54am)
So you want to make a website that hosts a multi-user raffle?

If you don't mind not actually displaying a wheel then this could be accomplished easily with a database of users/tickets and a random number generator.


I would be willing to do that. Like i said i am very new and am committed to invested the time to learn all that i need to. I appreciate any input in tge right direction

Edit can i display the user who wins?

This post was edited by im_the_jew on Jan 30 2017 09:35am
Member
Posts: 3,076
Joined: Jul 14 2006
Gold: 3.69
Jan 30 2017 07:46pm
Quote (im_the_jew @ Jan 30 2017 07:35am)
I would be willing to do that. Like i said i am very new and am committed to invested the time to learn all that i need to. I appreciate any input in tge right direction

Edit can i display the user who wins?


So i guess instead of tickets i can assign numbers. First person gets number 1 through whatever. So on and so fourth. How do i then use a number generator that will flucuate. Example.
Person a gets numbers 1 through 300. Person b gets 301 to 1000. Person c gets 1001 through 9000. My question is then how do i assign the number generator to only pick through those numbers. And they will vary every time, like person a could do 1 through 4300 the next time ect ect.
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Jan 31 2017 07:03am
Quote (im_the_jew @ Jan 30 2017 08:46pm)
So i guess instead of tickets i can assign numbers. First person gets number 1 through whatever. So on and so fourth. How do i then use a number generator that will flucuate. Example.
Person a gets numbers 1 through 300. Person b gets 301 to 1000. Person c gets 1001 through 9000. My question is then how do i assign the number generator to only pick through those numbers. And they will vary every time, like person a could do 1 through 4300 the next time ect ect.


What I would to is create a simple database that stores every persons highest number and lowest number, so it might look like:

Code
name Low High
Joe 1 100
Dave 101 101
Sally 102 4000


And then generate a random number, X, and do something like

Code
SELECT name FROM ticket_table WHERE low <= x AND high >= x;


/e and then just clear the database after each drawing.

This post was edited by Mastersam93 on Jan 31 2017 07:07am
Member
Posts: 3,076
Joined: Jul 14 2006
Gold: 3.69
Jan 31 2017 12:10pm
Quote (Mastersam93 @ Jan 31 2017 05:03am)
What I would to is create a simple database that stores every persons highest number and lowest number, so it might look like:

Code
name Low High
Joe 1 100
Dave 101 101
Sally 102 4000


And then generate a random number, X, and do something like

Code
SELECT name FROM ticket_table WHERE low <= x AND high >= x;


/e and then just clear the database after each drawing.


Thanks! I really appreciate this!
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll