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.
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.
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.
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 ");
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.
I have not started yet, but i dont know what i need classes, methods, techniques
System.out.println(" dream in code ");
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.
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 ");
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.
precisely!The FEN-notation string shows what is on all 64 squares of the board.
Some are empty, some have pieces on them
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 ");
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.
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 ");
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.
maybe a field and method isEmpyt(). how do i make the FEN classHow will a Square know what piece is on it
System.out.println(" dream in code ");
What is that class for? What data will it hold? What methods will it have?how do i make the FEN class
If you don't understand my answer, don't ignore it, ask a question.
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 ");
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.
any idea how i can build that?
System.out.println(" dream in code ");
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.
Hijacked thread, or did Woverine89 used to be gokuball?
See post#36Woverine89 used to be gokuball
If you don't understand my answer, don't ignore it, ask a question.
Thanks for the map. I'd have never found that needle in this haystack.
- 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 ");
That is the important bit. Expand that to the simple steps that need to be done.Check the FEN-notation (is it a correct FEN notation Length and legal characters
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.
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 ");
Of course, you need to look at every character of the FEN-notation string.Check every next character?
If you don't understand my answer, don't ignore it, ask a question.
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 ");