Results 1 to 5 of 5
  1. #1
    mrprogrammer is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Post Help me guys do my very first java game!!!!

    Hey guys, i'm making a typing game and i am begging all of you to help me. Of course you will all have credit if you help me. I have some problems making the next word appear after you get the first one. And can also help me guys on how to put a 2 minute timer? Here's the code:

    Java Code:
    import java.util.Random;
    import java.util.Scanner;
    
    public class Easy {
        
        public static void main (String []args){
            
            String words[]={"Love", "Hate", "Truth", "Happy", "Pressure", "Burp", "Vampire"
            , "Surf", "Believe", "Slime", "Dream", "Religion", "Rhythm", "Disco", "Honey",
            "Star", "Armies", "Zombie", "Heart", "Break", "Docks", "Multiply", "Mace", "Moustache"
            , "Wizards", "Sports", "Blind", "Riddle", "Business", "School", "Blood", "Promenade",
            "Vault", "Spray", "Eternal", "Dress", "Abstain", "Controls", "Circuit", "Forever",
            "Dangerous", "Skunk", "House", "Wives", "Flashlight", "Console", "Awesome", "Scared",
            "Hormones", "Promise", "Angel", "Baggage", "Duck", "Destroy", "Tissue", "Ketchup",
            "Picture", "Basket", "Basketball", "Fan", "Dough", "Thief", "Female", "Family", "Normal",
            "Wireless", "Empty", "Cycles", "Banana", "Eggplant", "Samba", "Jumble", "Flush", "Beach",
            "Driver", "Queen", "Mommy", "Fade", "Kitten", "Spring", "Interest", "Debts", "Horse",
            "Tomorrow", "Discount", "Faithful", "Midnight", "Epic", "Calendar", "Roses", "Funeral",
            "Badminton", "Spirit", "Water", "Pizza", "Science", "Cabinet", "Apple", "Television",
            "Profile", "Wine", "Sedan", "Luxury", "Firewall", "Computer", "Tablet", "Giraffe", "Ring",
            "Shut", "Vision", "World", "War", "High", "School", "Fantasy", "Warfare", "Incognito",
            "Loading", "Penguins", "Fright", "Night", "Diary", "Mega", "Submit", "Hold", "Statue",
            "Boat", "Mobile", "Invisible", "Visible", "Ground", "Space", "Dragon", "Spade", "Clover",
            "Senior", "Junior", "Sophomore", "Freshman", "Twilight", "Dawn", "Eclipse", "Moon",
            "Hair", "Spray", "Camp", "Jazz", "Rock", "Eggs", "Hustle"};
            
           Scanner sc = new Scanner(System.in); 
           Random a = new Random();
           int roll = a.nextInt(149);
           String type = "";
           String reply = "yes";
           int error = 0;
           
           System.out.println(words[roll]);
        
        while (!reply.equalsIgnoreCase("no")){
        	if (!reply.equalsIgnoreCase("yes"))
        		System.out.println("Yes and No are the only acceptable answers");
        	
        	else {
        		System.out.println("Type the word");
        		
        		
        		
        		
        		while (!type.equals(words[roll])){
        			type = sc.next();
        			try {
        				if (!type.equals(words[roll])){
        					System.out.println("Type again");
        					error++;
        					}
        				else {
        					if (!type.equals(words[roll]))
        					System.out.println("next word");
        					      
        				}
        					
        			}catch(Exception e){
        				
        				System.out.println("lallalala");
        			}
        			
        		}
        	}
        	type = "";
    		System.out.println("Would you like to play again? Yes/No");
    		reply = sc.nextLine();
    		roll = a.nextInt(149);
    		
    		
    		
        }
        System.out.println("Thank you for playing");
        }
    }
    ADVANCED THANK YOU GUYS FOR HELPING ME!!!
    Last edited by mrprogrammer; 08-21-2012 at 12:23 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Help me guys do my very first java game!!!!

    Please go through the Forum Rules -- particularly the second and third paragraphs.

    Your other thread has been closed.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    mrprogrammer is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Default Re: Help me guys do my very first java game!!!!

    Quote Originally Posted by DarrylBurke View Post
    Please go through the Forum Rules -- particularly the second and third paragraphs.

    Your other thread has been closed.

    db
    Sorry, i've duplicated my post accidentally

  5. #5
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: Help me guys do my very first java game!!!!

    If this is a command line app, have you looked at Timer (Java Platform SE 6) timers?

Similar Threads

  1. Hi guys i am new to programming in java
    By karthikumar1986 in forum New To Java
    Replies: 6
    Last Post: 03-11-2011, 08:52 AM
  2. Hi guys i am new to java
    By karthikumar1986 in forum New To Java
    Replies: 1
    Last Post: 03-04-2011, 09:23 AM
  3. help guys on java me
    By arc_remiel in forum New To Java
    Replies: 6
    Last Post: 02-24-2011, 04:21 PM
  4. hi guys help me in math.random () in java
    By funkygarzon in forum New To Java
    Replies: 5
    Last Post: 08-09-2010, 04:48 AM
  5. Cheers to Java Guys
    By right2001 in forum Introductions
    Replies: 0
    Last Post: 02-16-2009, 03:10 AM

Posting Permissions

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