Results 1 to 2 of 2
  1. #1
    leviathan is offline Member
    Join Date
    Jun 2010
    Posts
    8
    Rep Power
    0

    Default Require serious help (scabble like game again sorry...)

    EDIT: take out alot of my codes to prevent mis use...still require alot of help on this


    Ok, firstly i have to apologize to many since alot have help others in this similiar situation.

    However i was given an assignment that im somehow stuck on a couple things before i reach complete.

    The things that im currently lacking are " Checking with the words.txt and my inputs to see if it matches "

    and i cant seem to get my jar file to work i suppose...

    to make it simple, i need to make sure my inputs are corrosponding to my 10letter generated and then check with my word.txt to check if its a valid word...

    and some try-catch function to highlight what is the error.

    Sorry i know its alot of work :(

    My current full code below:

    Java Code:
    	// *****************************************************************************************************************
    
    	public static void main(String[] arg) {
    		points = 0;
    
    		// word game array
    		alphabet[0] = 'a';
    		alphabet[1] = 'b';
    		alphabet[2] = 'c';
    		alphabet[3] = 'd';
    		alphabet[4] = 'e';
    		alphabet[5] = 'f';
    		alphabet[6] = 'g';
    		alphabet[7] = 'h';
    		alphabet[8] = 'i';
    		alphabet[9] = 'j';
    		alphabet[10] = 'k';
    		alphabet[11] = 'l';
    		alphabet[12] = 'm';
    		alphabet[13] = 'n';
    		alphabet[14] = 'o';
    		alphabet[15] = 'p';
    		alphabet[16] = 'q';
    		alphabet[17] = 'r';
    		alphabet[18] = 's';
    		alphabet[19] = 't';
    		alphabet[20] = 'u';
    		alphabet[21] = 'v';
    		alphabet[22] = 'w';
    		alphabet[23] = 'x';
    		alphabet[24] = 'y';
    		alphabet[25] = 'z';
    
    		// *****************************************************************************************************************
    
    		System.out.println(" Find Your Words");
    		generateRandom();
    
    		try {
    
    			// player 1
    			while (playerTurn == true) {
    				System.out.print("Player 1  :");
    				generateRandom();
    				for (int j = 0; j < wordGame.length; j++) {
    					System.out.print(wordGame[j] + " ");
    				}
    
    				System.out.println();
    				System.out
    						.println("Enter your World ( or Press  !  to PASS or Press @  To Quit )");
    				inputs = scan.next();
    				playerInput = inputs.toCharArray();
    
    				for (int c = 0; c < playerInput.length; c++) {
    					inputs = inputs.toUpperCase();
    				} // end UpperCase
    				System.out.println(playerInput);
    
    				// *****************************************************************************************************************
    				// Passing the game
    
    				if (inputs.equals("!")) {
    					System.out.println("Total score for word: 0");
    					System.out.println("Total score for game: " + player1);
    					player1 += 0;
    					playerTurn = false;
    
    				// *****************************************************************************************************************
    				// Exiting the game
    
    				} else if (inputs.equals("@")) {
    					System.out.println("Player 1 score: " + player1);
    					System.out.println("Player 2 score: " + player2);
    
    					if (player1 > player2) {
    						System.out.println("player 1 won the game");
    					} else if (player1 == player2) {
    						System.out.println("Its a draw");
    					} else
    						System.out.println("Player 2 won the game");
    					break;
    
    					// *****************************************************************************************************************
    					// Inputs for wordGame
    
    				} else {
    					System.out.println("here");
    					pointAssign();
    					player1 += points;
    
    					System.out.println("Total score for word: " + points);
    					System.out.println("Total score for game: " + player1);
    					playerTurn = false;
    					points = 0;
    				}
    
    				// *****************************************************************************************************************
    				}
    Last edited by leviathan; 06-04-2010 at 11:59 AM.

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Sorry but the forum is to share some skills not to solve ones :(
    Show us the problem code. Exception trace or something...

Similar Threads

  1. SCJP Voucher require
    By sithes.nmc@gmail.com in forum Java Certification
    Replies: 0
    Last Post: 02-11-2010, 03:10 PM
  2. Require HELP, Please
    By nura23 in forum New To Java
    Replies: 5
    Last Post: 01-10-2010, 03:41 AM
  3. I require some urgent help... plzzzz help me
    By Hurricane in forum New To Java
    Replies: 3
    Last Post: 08-29-2009, 07:49 PM
  4. Require Help with Layout (GridBag)
    By hemanthjava in forum AWT / Swing
    Replies: 2
    Last Post: 10-22-2008, 02:56 PM
  5. Require some insight!
    By Shaolin in forum JavaServer Pages (JSP) and JSTL
    Replies: 13
    Last Post: 07-16-2008, 12:36 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
  •