Java Chess Programming Video #26 The Move (Part VI)

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

Chess Code Repository :

IDE:

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

At 16:36 you make a isRook() statement "true" for Queen and for King xD
But ok, you see its 2k20 and people (me) still learn a lot from your video ;)
Thank you boi!

ardecho_eso
Автор

I'm sure by now this is fixed but king and queen were set to return true for isRook() in case it hasn't been mentioned. time - 16:30

cassiusmusic
Автор

Could you not check if it is the rook's first move? Cause if it is it's first move and it is placed on the right tile, then it have to be the rook. Then you would not have to make the isRook() method. Or am I thinking wrong here?
Loving the series though! Keep it up :D

jespernylend
Автор

Why are we not checking if the 63rd tile, i.e the rook tile is under attack from any opponent piece too? If the rook is under attack then castling will bring a check on the king so it is also an invalid move, right?
Great tutorial btw. Having a great time and leaning a lot about how the game engines work.

insane
Автор

As an alternative, would this work just as well? .. "if square.getPiece().getType() == PieceType.ROOK"

clarkflavor
Автор

Isn't there a bit of duplicate code with all of the IsKing() / isRook() methods ? Wouldn't it be better to make concrete methods returning false in the Piece class, then simply Overriding them to return true in the 2 cases where they are true ? (in the King and Rook enums)

paulgirard
Автор

dont u have to check at queen side castling for attack on tiles too ?
and i think it's legal move allowing castilng though opponent can attack u (as long u dont threat the king - tiles 57 and 62)
thanks for the series!

talbs
Автор

Hi, been following along with this series in 2017 and it's been great. A question: wouldn't it be better practice to nest the checks for rookTile.isTileOccupied() and ? Since getPiece() in the EmptyTile class returns null, we'd get a NullPointerException when we try to look up its first move status. You probably address this in a later video, I dunno.

Thanks for making these!

averagegatsby
Автор

Hi, why can't you just check if the piece on the tile is an instance of rook (i.e. rookTile.getPiece() instanceof Rook) instead of rookTile.getPiece().isRook()?

TamzRahman
Автор

can explain me calculateKingCastles how work ?

abdh
Автор

At this point, your program will no longer coverage chess960 rules!

geracontrato