DesolateCarnage.net
Members
|
Search
Hey Guest
Options Menu
DC Forums
→
Help & Suggestions
→ Lotto
Lotto
Archived | Views: 1878 | Replies: 7 | Started 16 years, 4 months ago
#301658 |
Mon - Aug 18 2008 - 13:45:36
xSoRx
Group: Guest
Posts: 2,131
Joined: Jul 2 2007
Contact:
Offline
PM
Points
:
1.28
CODE
<?php
class Lotto {
public $lotto_pick;
public $lotto_choice;
function __construct ( $pick_array, $ID )
{
global $user;
$sql->query('INSERT INTO `lotto_picks` SET `pick_one` = ' . $pick_array[0] . ', `pick_two` = ' . $pick_array[1] . ', `pick_three` = ' . $pick_array[2] . ', `drawing_ID` = ' . $ID . ', `username` = ' . $sql->escape($user->info('name')) . '\'');
}
function drawTicket ( $lottoID )
{
$Picked = array ( 0 => rand(1, 36),
1 => rand(1, 36),
2 => rand(1, 36)
);
$q = $sql->query ( 'SELECT `pick_one`, `pick_two`, `pick_three` FROM `lotto_picks` WHERE `drawing_ID` = ' . $lottoID );
while ( $row = $sql->fetch_row ( $q ) )
{
$matches = 0;
if ( $Picked[0] == $row[0] )
++$matches;
if ( $Picked[1] == $row[1] )
++$matches;
if ( $Picked[2] == $row[2] )
++$matches;
}
}
?>
Couldn't be bothered to write anymore. Of course, you'd have to use a loop for all of the picks, and add the stuff that takes a percentage out of the jackpot. And the addition to the query to increase the jackpot with each ticket.
But wouldn't something like this work? Ofc modified, since this is Invision or w/e.
#301662 |
Mon - Aug 18 2008 - 13:47:01
blind_chief
Group: Members
Posts: 74,198
Joined: Oct 25 2006
Contact:
Offline
PM
Points
:
6,883.75
in b4 pie gets pissed all over again about the lotto
#301670 |
Mon - Aug 18 2008 - 13:55:30
xSoRx
Group: Guest
Posts: 2,131
Joined: Jul 2 2007
Contact:
Offline
PM
Points
:
1.28
Quote (blind_chief @ Aug 18 2008 - 13:47:01)
in b4 pie gets pissed all over again about the lotto
kek
just trying to help solve the problem
#301678 |
Mon - Aug 18 2008 - 14:02:37
smoked
Group: Members
Posts: 47,603
Joined: Sep 1 2006
Contact:
Offline
PM
Points
:
44,538.17
Quote (xSoRx @ Aug 18 2008 - 14:55:30)
Quote (blind_chief @ Aug 18 2008 - 13:47:01)
in b4 pie gets pissed all over again about the lotto
kek
just trying to help solve the problem
Problem solved by making it go away
#301686 |
Mon - Aug 18 2008 - 14:09:13
xSoRx
Group: Guest
Posts: 2,131
Joined: Jul 2 2007
Contact:
Offline
PM
Points
:
1.28
Quote (smoked @ Aug 18 2008 - 14:02:37)
Quote (xSoRx @ Aug 18 2008 - 14:55:30)
Quote (blind_chief @ Aug 18 2008 - 13:47:01)
in b4 pie gets pissed all over again about the lotto
kek
just trying to help solve the problem
Problem solved by making it go away
now i'll be at 19k fps forever
#301687 |
Mon - Aug 18 2008 - 14:09:49
smoked
Group: Members
Posts: 47,603
Joined: Sep 1 2006
Contact:
Offline
PM
Points
:
44,538.17
Quote (xSoRx @ Aug 18 2008 - 15:09:13)
Quote (smoked @ Aug 18 2008 - 14:02:37)
Quote (xSoRx @ Aug 18 2008 - 14:55:30)
Quote (blind_chief @ Aug 18 2008 - 13:47:01)
in b4 pie gets pissed all over again about the lotto
kek
just trying to help solve the problem
Problem solved by making it go away
now i'll be at 19k fps forever
Gamble with sports ofceci
#301696 |
Mon - Aug 18 2008 - 14:17:02
Raffles
Group: Guest
Posts: 14,414
Joined: Oct 2 2007
Contact:
Offline
PM
Points
:
1,162.65
pie declared himself not smart enough to fix the lotto
cannot w8 for reply
#301701 |
Mon - Aug 18 2008 - 14:23:24
pkxd
Group: Guest
Posts: 584
Joined: May 18 2008
Contact:
Offline
PM
Points
:
69.00
Warn: 30%
whats gonna happen when he poops
Archived | Views: 1878 | Replies: 7 |
Help & Suggestions Topic List
Quit the Internet
DC Forums powered by
___
and
3rror.org
© 2006-2015