Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    argnsoccer is offline Member
    Join Date
    Oct 2010
    Posts
    14
    Rep Power
    0

    Default

    I feel like the problem is that I do not reset the array before each case, but I am not sure how to do that.

  2. #22
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    5

    Default

    Something like this may do the trick:

    Java Code:
    public void resetBoard()
    {
         for(int i = 0; i < rows; i++)
              for(int j = 0; j < columns; i++)
                   board[rows][column] = null;
    }
    Sincerely, Joshua Green
    Please REP if I help :)

  3. #23
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    You bypass each of the case statements when direction==0

    But you were getting the exception at LegalMove() case 5 (assuming that's line 75). So EITHER putting

    Java Code:
    System.out.println("row="+row+"column="+column);

    at the start of that case block will print some useful diagnostic information OR you don't get the exception.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Java cannot find symbol- variable img
    By crutchfieldj in forum New To Java
    Replies: 3
    Last Post: 04-13-2010, 10:47 PM
  2. Cannot find symbol variable - Why? I can.. ^^
    By Mattedatten in forum New To Java
    Replies: 4
    Last Post: 03-08-2010, 07:07 PM
  3. Error "can not find symbol variable"
    By FullMetalHollow in forum New To Java
    Replies: 5
    Last Post: 10-04-2009, 09:51 PM
  4. Cannot find symbol variable pD! I cant fix it!!!
    By Addez in forum New To Java
    Replies: 2
    Last Post: 09-17-2009, 08:32 PM
  5. Cannot find symbol variable yourScore
    By Addez in forum New To Java
    Replies: 4
    Last Post: 08-17-2009, 10:48 PM

Tags for this Thread

Posting Permissions

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