Hi

I need help in creating a roulette script for my mafia game, http://www.the-streets-of-london.co.uk. I can't work out how to do the main basis of the game.

Basically, there is a form, with lots of text boxes for the diffrent bets that they can make, from textbox for 1, 2, 3...36 then for 1st col, black, red etc. Anyone familiar with the game will know. In each box they enter in the bet they want to make, so if they wanted to make a bet of £10 on red, they would type it into the box next to red.

What i cant then work out, is how to get the number that is picked, with the correct colour, then also work out what they have won.

If anyone could help, i would love u! lol

Also need help with creating a black jack game, if anyone is any good at that sort of thing. Cheers!

    This can kind of get you started... I won't go too much into this if this isn't what you are talking about, so take a look, and see if it's worth pursuing...

    $array = range(1,36);
    $number = rand(1,36);
    
    function odd($var) { 
       return($var % 2 == 1); 
    } 
    
    function even($var) { 
       return($var % 2 == 0); 
    } 
    
    $odds = array_filter($array, "odd"); 
    $evens = array_filter($array, "even"); 
    
    if (in_array($number, $odds)) { 
       echo "Odd: ".$number; 
    } elseif (in_array($number, $evens)) { 
       echo "Even: ".$number;
    }
    

      Personally, I would create a roulette table object, which represents the playing field. You can create properties which tell you the characteristics of each value (red/black, odd/even, 1-12, column, etc.), and methods like spin_wheel to return the current number.

      Remember, in a Roulette game, you can also place chips between two numbers, 4 numbers, 6 numbers, etc. There are MANY ways to bet in roulette -- are you going to cover them all?

        how about a russian rullette game, if you win then your computer gets a virus

          Write a Reply...