Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: hey - Mobile phone drinking game

  1. #1
    Junior Member pazzy's Avatar
    Join Date
    Jul 2009
    Location
    Wales
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hey - Mobile phone drinking game

    hey im an absoulte noob to java but im lookin for a counter! lol its for a drinkin game
    but i wanna load it to my fone?
    it needs to start from 1 and count to 60 then make a buzzer noise then start again up untill 100 minutes
    could any1 shed sum light on this


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Thumbs up Re: hey

    lol this is one of the best things posted here so far A Java application for a drinking game!

    Is this where you drink a shot of beer every minute for 100 minutes? You end up drinking 9 pints or something

    This can be done with JavaME and uploaded onto your phone as a .jar file. When do you need this by?

    Java ME - the Most Ubiquitous Application Platform for Mobile Devices
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member pazzy's Avatar
    Join Date
    Jul 2009
    Location
    Wales
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hey

    there is no rush lol
    its a project thats been on my mind for a while and the idea of a java app on the phone was a stroke of genius by myslef lol! but i lack the programing knowledge to mack it happen

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: hey

    I don't have much experience with JavaME but i'm going to install it and hopefully write this for you.

    I wrote a JavaSE console version. This is the basic code:

    public class DrinkingGame {
     
        /**
         * JavaProgrammingForums.com
         */    
        int maxMinutes = 100;
        int count = 1;
        int start = 0;
     
        public void Counter() {
     
            try {
     
                for(int a = 0; a < 60; a++){
                    System.out.print(count + " ");
                    Thread.sleep(1000);
                    count++;
                    if(count == 60){
                        // Buzzing sound code here
                        System.out.println("BUZZING SOUND!");
                        start++;
                        Thread.sleep(1000);
                        count = 1;
                        if(start == maxMinutes){
                            System.out.println("Game over. Your officially drunk!");
                            System.exit(0);
                        }else{
                            Counter();
                        }
                    }
                }            
     
     
            }catch(InterruptedException e){
                System.out.println("Ouch! The counter fell over");
            }
        }
     
        public static void main(String[] args) {
            System.out.println("Ready.. Set.. Go");
            DrinkingGame drink = new DrinkingGame();
            drink.Counter();
        }
    }
    It counts 1 - 60 then plays a buzzing sound and does this 100 times.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  5. #5
    Junior Member pazzy's Avatar
    Join Date
    Jul 2009
    Location
    Wales
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hey

    how would i go about testin this????
    what application shall i use ?

  6. #6
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: hey

    Follow this:

    "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)

    But instead of using the HelloWorldApp class, copy & paste the above code.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  7. #7
    Junior Member pazzy's Avatar
    Join Date
    Jul 2009
    Location
    Wales
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hey

    nah i cant get ir to run ???? the java software wont install??? can sum1 make this a .jar file so i can try installing it on my fone

  8. #8
    Junior Member pazzy's Avatar
    Join Date
    Jul 2009
    Location
    Wales
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hey

    can any1 help?????

  9. #9
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: hey

    Hey pazzy,

    Sorry for the delay on this. I'll hopefully pick it up tomorrow morning and get back to you!
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  10. #10
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: hey

    Anyone got JavaME installed?!?! Having problems installing it here at work...
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Tags for this Thread