Java Chess Programming Video #42 En Passant

preview_player
Показать описание

Chess Code Repository :

IDE:

Reading Material:
Рекомендации по теме
Комментарии
Автор

WARNING: At 10:40 time, set the enPassantPawn at the location as shown in the video. Do not place that line below calculateLegalMoves lines.
I got a bug in my code after I made that mistake, and it was very hard to debug that issue. I wasted 2 days.

By the way, Amir, you are doing a great job. I love your code quality.

chirayujoshi
Автор

For the past 3 days, I have spent 40+ hours and reached here. What an amazing series. Thank you!

Linguaholic
Автор

Watching this in 2018 great series Amir you are a legend

nazirelpustaty
Автор

Watching this in 2020 and its still a great series !

I just started studying and tried to learn how to code a chess game and found this series. It helped me so much, thank you !

Hope you continue making videos.

moritzwieland
Автор

Hey Amir! I'm loving this programming series, really well explained, clear and concise. About 2 years ago I tried making a game similar to chess but with added features and slightly different gameplay, the route I took wasn't great and after watching this I already know a lot more about the ways in which I can improve my code, so just wanted to comment to say thanks for all the hard work you've put in to continually creating and uploading these videos!

JayCeeVids
Автор

Hello Amir, i just wanted to say thank you so much, this course learned me so much so far, and i have been able to follow along. Thank you again. I am planing on doing on doing a chess game as my final University exam, i still have to learn a lot and of course work a lot, but your videos helped me an incredible amountt, i am able to undestand the game engine.

Thank you again my dude, for getting this video series on youtube for free. and i truly wish you the best !!! <3

AnonimMadess
Автор

Biadar, kheili khobsoorati, ha! Big thumbs up, my handsome brother.

lionpersia
Автор

Hello,
I see an IIOException error at the end of video # 42.
But in video # 43 I do not see debugging
Where is the problem?
here is the code:
         for (final Piece takenPiece: blackTakenPieces) {
             try {
                 System.out.println (). ToString (). Substring (0, 1));
                 final BufferedImage image = ImageIO.read (new File ("art / pieces / plain"
                         + takenPiece.toString ()
                         + ".png"));
                 final ImageIcon ic = new ImageIcon (image);
                 final JLabel imageLabel = new JLabel (new ImageIcon (ic.getImage (). getScaledInstance (
                         ic.getIconWidth () - 15, ic.getIconWidth () - 15, Image.SCALE_SMOOTH)));
             // this.northPanel.add (imageLabel);

             catch (final IOException e) {
                 e.printStackTrace ();
             }
         }

oaiduongthanh
Автор

Hi Amir,
Was it necessary to introduce the new class "MajorAttackMove" actually?
Why couldn't we just use the AttackMove class as before?
Thank you!

m_r.o
Автор

Note: if you had your setEnPassantPawn as the following:

public void setEnPassantPawn(Pawn movedPawn) {
this.enPassantPawn = enPassantPawn;
}

then if you change it to:
public Builder setEnPassantPawn(final Pawn enPassantPawn) {
this.enPassantPawn = enPassantPawn;
return this;
}
Then your en passant should work. After writing all the code today I was confused it wasnt working, until I found this.

johnnystace
Автор

Thanks for this video sir. Also shouldn't we set enPassantPawn to null after some other move is made instead of the pawn capture? En passant capture move should be made in the immediate next move as per the definition.

pratyushpatil
Автор

Wouldn't setting the "enPassantPawn" variable to be "enPassantTile" work better? Then you could just check if a pawn diagonal was on that square. Especially because when using FEN that is how it is laid out.

superepicproportions
Автор

Hi, I haven't looked at all the videos but is seems awesome. But the only think left is 41 is the last part of the series or there is still some videos that u haven't uploaded. I just want to clarify it in order to know after 41 video I will end up with a application that works and instructor won't or didn't give up at the middle of it
Aliew in video ha ;)

MJ-inwt
Автор

hello, there is no legal move for my pawn to capture another pawn, where could be the problem?

_meric_
Автор

Hi Amir, another very well explained and beneficial video :)
I've run into a peculiar problem, where a Pawn will not execute the En Passant move despite being highlighted as a legal move. After debugging, I've found that the Pawn adds the EnPassantAttackMove to it's list of legalMove's, however this never gets transferred to the current player's legal moves and thus the move never gets carried out. Could you please help identify the issue? Cheers, and keep up the great work :)

Hooghog
Автор

Greetings Sir, Having a great time learning from you.
Here, My Pawn is not attacking the En Passant Move, but it is highlighting that move. I tried to debug and solve the problem, but not able to find the mistake. Please help me..

jivesh