@@ -421,7 +421,6 @@ func (b *boardStruct) genKingMoves(ml *moveList) {
421421 if b .sq [castl [sd ].rookSh ] == castl [sd ].rook && // NOTE: Maybe not needed. We should know that the rook is there if the flags are ok
422422 (castl [sd ].betweenSh & b .allBB ()) == 0 {
423423 if b .castlingShOk (sd ) {
424- // TODO: not in check and between not attacked
425424 mv .packMove (uint (b .King [sd ]), uint (b .King [sd ]+ 2 ), uint (b.sq [b.King [sd ]]), empty , empty , uint (b .ep ), uint (b .castlings ))
426425 ml .add (mv )
427426 }
@@ -430,7 +429,6 @@ func (b *boardStruct) genKingMoves(ml *moveList) {
430429 // long castling
431430 if b .sq [castl [sd ].rookL ] == castl [sd ].rook && // NOTE: Maybe not needed. We should know that the rook is there if the flags are ok
432431 (castl [sd ].betweenL & b .allBB ()) == 0 {
433- // TODO: not in check and between not attacked
434432 if b .castlingLOk (sd ) {
435433 mv .packMove (uint (b .King [sd ]), uint (b .King [sd ]- 2 ), uint (b.sq [b.King [sd ]]), empty , empty , uint (b .ep ), uint (b .castlings ))
436434 ml .add (mv )
@@ -741,7 +739,6 @@ func (b *boardStruct) genFrMoves(p12 int, toBB bitBoard, ml *moveList) {
741739
742740// is sq attacked by the sd color side
743741func (b * boardStruct ) isAttacked (sq int , sd color ) bool {
744- // TODO: Fixar inte alla attacker både true och false
745742 if pawnAtks [sd ](b , sq ) {
746743 return true
747744 }
@@ -796,7 +793,6 @@ func (b *boardStruct) bPawnAtks(sq int) bool {
796793
797794// print all legal moves
798795func (b * boardStruct ) printAllLegals () {
799- // TODO: det blir felaktigheter från inCheck() move eller unmove
800796 var ml moveList
801797 b .genAllMoves (& ml )
802798 fmt .Println (ml .String ())
@@ -1054,6 +1050,8 @@ func pc2P12(pc int, sd color) int {
10541050 return (pc << 1 ) | int (sd )
10551051}
10561052
1053+
1054+
10571055// map fen-sq to int
10581056var fenSq2Int = make (map [string ]int )
10591057
0 commit comments