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.

Page 3 of 9 FirstFirst 12345 ... LastLast
Results 51 to 75 of 219

Thread: Chess Program

  1. #51
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    I'm talking about the displayed board and the position of pieces on it as controlled by the FEN-notation.
    Not about how the program stores that data internally.
    If you don't understand my answer, don't ignore it, ask a question.

  2. #52
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    Yes the FEN-notation controls the position of the pieces if the FEN-notation is changed( press enter) the pieces on the board move to that postition
    the first character in the FEN-notation the lower case 'r' is also the left upper corner of the earlier gridlayout(board) we build
    System.out.println(" dream in code ");

  3. #53
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    What is the problem now using a FEN-notation String that shows where the pieces go row by row to position all the pieces on the board?
    If you don't understand my answer, don't ignore it, ask a question.

  4. #54
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    I have not started yet, but i dont know what i need classes, methods, techniques
    System.out.println(" dream in code ");

  5. #55
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    Start by describing what the code needs to do. When that is decided, then worry about the code that is needed to do it.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #56
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    Screen Shot 2013-08-10 at 1.37.31 PM.jpg

    I need an FEN-Notation which represent the chesspieces and the squares(locations) on the board. If a user enters his own FEN notation like this one
    rnbqkbnr/pp1pppppp/2p5/8/8/8/8/PPPPPPPP/RNBQKBNR the chesspiece Image moves to that position.

    the / does nothing but between two / / there are 8 squares. and if a row is empty it shows 8
    System.out.println(" dream in code ");

  7. #57
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    What will the code do that reads the String with the FEN-notation?
    The FEN-notation string shows what is on all 64 squares of the board.
    Some are empty, some have pieces on them.

    When the code extracts a character from the String representing a piece, it will know what row and column that piece goes on
    If you don't understand my answer, don't ignore it, ask a question.

  8. #58
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    The FEN-notation string shows what is on all 64 squares of the board.
    Some are empty, some have pieces on them
    precisely!

    The only thing the fen notation does when you change it is (fill in a notation and press enter) place the pieces on the right location/square
    System.out.println(" dream in code ");

  9. #59
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    I'm confused what your problem is. Can you explain?
    What more do you need to do besides read the FEN-notation string and use it to put pieces on the board?
    If you don't understand my answer, don't ignore it, ask a question.

  10. #60
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    nothing but my problem is "how" do i make that! Maybe Class FEN and what kind of methods how to make the string and put the pieces on the board

    do i have to assign a letter to an piece object(image)..
    System.out.println(" dream in code ");

  11. #61
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    How are pieces to be shown on the board? How will a Square know what piece is on it and how will it show that piece?
    The FEN_notation string gives the piece and its location.
    The chessboard will need a way to put a piece on a square.
    If you don't understand my answer, don't ignore it, ask a question.

  12. #62
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    How will a Square know what piece is on it
    maybe a field and method isEmpyt(). how do i make the FEN class
    System.out.println(" dream in code ");

  13. #63
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    how do i make the FEN class
    What is that class for? What data will it hold? What methods will it have?
    If you don't understand my answer, don't ignore it, ask a question.

  14. #64
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    that are my questions:p dont know? somewhere the FEN-notation has to be checked if the notation is correct and when its correct the pieces must be placed on the right location
    System.out.println(" dream in code ");

  15. #65
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    That sounds like what a method does: read the string and position the pieces.
    If you don't understand my answer, don't ignore it, ask a question.

  16. #66
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    any idea how i can build that?
    System.out.println(" dream in code ");

  17. #67
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    What is the method supposed to do? Describe in detail.
    Define all the steps the method needs to do first before writing any code.
    Make a list of the steps it should do.
    If you don't understand my answer, don't ignore it, ask a question.

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

    Default Re: Chess Program

    Hijacked thread, or did Woverine89 used to be gokuball?

  19. #69
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    Woverine89 used to be gokuball
    See post#36
    If you don't understand my answer, don't ignore it, ask a question.

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

    Default Re: Chess Program

    Thanks for the map. I'd have never found that needle in this haystack.

  21. #71
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    - It has to read the FEN-notation
    - Check the FEN-notation (is it a correct FEN notation Length and legal characters otherwise exception e, if a "row" is empty it shows 8) but thats is diffibult i dont work with rows right only the location shows the row number
    - press enter
    - The piece objects need to be placed on the right location.
    System.out.println(" dream in code ");

  22. #72
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    Check the FEN-notation (is it a correct FEN notation Length and legal characters
    That is the important bit. Expand that to the simple steps that need to be done.
    There will be a loop.
    The logic needs to get the next character from the String.

    What tests need to be made? For example: Allow only one King and a max of 8 pawns.
    If you don't understand my answer, don't ignore it, ask a question.

  23. #73
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    exact, thats what the exercise describes! that kind of conditions.

    how do i do that? Check every next character?
    System.out.println(" dream in code ");

  24. #74
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Chess Program

    Check every next character?
    Of course, you need to look at every character of the FEN-notation string.
    If you don't understand my answer, don't ignore it, ask a question.

  25. #75
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Chess Program

    do i have to put the string in an array? and the how do i set the 8 slashes / so they never change? they are always there
    System.out.println(" dream in code ");

Page 3 of 9 FirstFirst 12345 ... LastLast

Similar Threads

  1. Simple chess program (no AI) - Need help with structuring my code
    By MineeMo in forum Object Oriented Programming
    Replies: 6
    Last Post: June 18th, 2012, 10:12 AM
  2. Chess game help
    By that_guy in forum Java Theory & Questions
    Replies: 3
    Last Post: December 4th, 2011, 08:42 PM
  3. checking for draw by repetition in chess app
    By aisthesis in forum Algorithms & Recursion
    Replies: 0
    Last Post: February 16th, 2011, 02:40 AM
  4. Chess Problem
    By pmg in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 10th, 2011, 12:07 PM
  5. Simple Chess program
    By x3rubiachica3x in forum What's Wrong With My Code?
    Replies: 23
    Last Post: September 22nd, 2010, 11:12 AM