Results 1 to 3 of 3
  1. #1
    dysfunktional is offline Member
    Join Date
    Apr 2009
    Posts
    4
    Rep Power
    0

    Default online ROULETTE CALCULATER

    I want to code my own online roulette calculater like roulette killer and roulette sniper.im still very new to javaso forgive me me for my errors!!
    this is as far as i got,can any one help me?

    on the roulette table some numbers are in 3 - 6 differnt sections ie. the number 28 is red , even ,2nd row ,so on and so on.would this be a problem and cause errors??

    3.im still very new to java but would i use alot of " if " statment's for this program

    (psudeo code)

    if input = red ( + 1) and when red = 7 print ("bet on red now")

    will i be able to apply all this to a gui interface?or should i just try code this in visual basic??

    Java Code:
    import java.util.scanner;
    
    public class Roulette 
    
    {
        public static void main (String [] args)
        {
            Scanner input = new Scanner (System.in);
            //variables
        
    int row1, row2, row3, first12, second12, third12, odd, even, red, black, oneto18, nineteento36, zero;
    
    row1 = 0;
    row2 = 0;
    row3 = 0;
    odd = 0;
    even = 0;
    first12 = 0;
    second12 = 0;
    third12 = 0;
    black = 0;
    red = 0; 
    
    
    
    system.out.println("enter numbers");
    
    
    
    
    row1 ==  34, 31, 28, 22, 19, 16, 13, 10, 7, 4, 1;
    row2 == 35, 32, 29, 26, 23, 20, 17, 14, 11, 8, 5, 2;
    row3 == 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3;  
    
    
    first12 == 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
    second12 == 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24;
    third12 == 25 26 27 28 29 30 31 32 33 34 35 6 
    
    
    even == 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36;
    odd == 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35;
    
    red == 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 36, 34;
    
    black == 2, 4, 6, 8, 11, 10, 13, 15, 17, 20, 24, 22, 26, 28, 29, 31, 33, 35;
    
    oneto18 == 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18;
    
    nineteento36 == 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36;
    
    0;
    
        }
    }

    any help would be great,cheers

  2. #2
    Join Date
    Feb 2009
    Posts
    9
    Rep Power
    0

    Default

    I'm sure you could apply this to a GUI interface, but unfortunately I don't know how it would be done.

    Out of curiosity, do you really know some algorithm to detect when to bet, or are you just guessing? If you know a method I would love to help because I need to code a GUI for my final project in Java this year.

  3. #3
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Firstly, that's not how you do arrays, or assignments. Check this out Trail: Learning the Java Language (The Java™ Tutorials)

    Secondly, you don't need to check numbers against arrays. For evens you can use (x % 2 == 0), for first12 you can use (x <= 12) and so on.

    Looks like you need to come up with some kind of data structure to represent which groupings a number is in. Maybe a bit field or a map of lists.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. Everlong Online
    By Afide in forum Jobs Offered
    Replies: 3
    Last Post: 05-03-2009, 08:02 AM
  2. Calculator Online(Without Button)
    By lizard_kanta in forum Java Applets
    Replies: 4
    Last Post: 04-29-2009, 08:12 PM
  3. A Online Card Game
    By GonzaloP in forum Networking
    Replies: 0
    Last Post: 12-28-2008, 07:37 PM
  4. Need little Help In Calculater Implementation..
    By realahmed8 in forum New To Java
    Replies: 6
    Last Post: 12-18-2008, 02:39 AM
  5. Battery - Online Strategy-RPG
    By M77 in forum Reviews / Advertising
    Replies: 1
    Last Post: 11-16-2008, 10:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •