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 3 of 3

Thread: Something wrong with my code.please help!

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Something wrong with my code.please help!

    /


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Something wrong with my code.please help!

    What is it supposed to do? I think you meant to iterate the array by varying i and j instead of row and column. In other words, check this line:

    if ( first[row][col] == 0 ) //if the location was not selected,print "_"

    Will row or col ever change?

    In Java, arrays are zero-based, meaning the first element of an array is myArray[0] and the last element of a 3-element array is myArray[2].

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Something wrong with my code.please help!

    /

Similar Threads

  1. What Did I Do Wrong With My Code?
    By zendorz in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 14th, 2013, 02:01 PM
  2. what is wrong with my code? please help
    By black.angel in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 13th, 2012, 02:34 PM
  3. what is wrong with my code?
    By bmb in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 7th, 2011, 09:03 AM
  4. want wrong with my code
    By drum in forum Member Introductions
    Replies: 1
    Last Post: May 20th, 2011, 09:06 AM
  5. What's Wrong With My Code?
    By arunjib in forum What's Wrong With My Code?
    Replies: 18
    Last Post: May 7th, 2011, 08:47 PM