Commit Graph

102 Commits

Author SHA1 Message Date
hugomanipoud2 7d75f02e26 final commit, castling can handle undo 2025-05-23 13:48:34 +02:00
hugomanipoud2 c7d7991a16 castling can be undone et redo, but only for the concerned castle, the
king will still move and the castlking variable for the other type of
castle will get + 1, still an improvement
2025-05-23 13:11:11 +02:00
hugomanipoud2 a37a1a8d76 Maybe last commit, i will try to allow castling with undolastmove 2025-05-23 12:40:43 +02:00
hugomanipoud2 9b5e116e42 As no one really does and undoes the same move twice in a row, id say
that undolast move is finished at 99%, this might be the last commit
before deadline, ill check if everything works
2025-05-23 12:35:22 +02:00
hugomanipoud2 29935b84dc undolast move works unless we do a move, undo it, redo the same again,
and undo it once again, it will give an incorrect state of the board, i
try debugging it with hashmaps prints, the hasmaps updates correctly,
the arraylist is emptied before adding the new pieces, idk what doesnt
work, here is the code with the debugging prints
2025-05-23 12:32:37 +02:00
hugomanipoud2 48a3f7468d still buggy but now state comes back to normal at turn 0 2025-05-23 11:49:01 +02:00
hugomanipoud2 dada9a54cf kind of works but bugged (a lot) 2025-05-23 11:28:54 +02:00
hugomanipoud2 11ba0933c3 works but i cant place pieces after 2025-05-23 11:10:54 +02:00
hugomanipoud2 a0d4ae6634 added docstrings and hashmap that should save state of board each turn 2025-05-23 11:05:52 +02:00
hugomanipoud2 7fe7f6c17e trying to implement undolastmove with hashmaps, they work like
dictionnaries in python, the key will be turnNb and the associated value
will be the arraylist associated
2025-05-23 10:50:59 +02:00
hugomanipoud2 f4cf1e6904 bug de parenthese avec short castle black, rectifié et marche 2025-05-23 10:32:17 +02:00
hugomanipoud2 f3b9526521 tostring now has a flag variable and is weel readable thanks to lines
skipped
2025-05-23 10:11:00 +02:00
hugomanipoud2 5e9ee6d35b toString updates each turnnb 2025-05-23 09:59:18 +02:00
hugomanipoud2 1395927d94 missing queen in last commit, now with all pieces 2025-05-22 21:32:07 +02:00
hugomanipoud2 248fdbda92 Castling is fully functional, i needed to split long and short, idk it
works so thats a win
2025-05-22 21:27:00 +02:00
hugomanipoud2 ee44342e4f short castle works but not long 2025-05-22 21:07:57 +02:00
hugomanipoud2 925681e178 short castle done and working, finishing long castle 2025-05-22 20:52:55 +02:00
hugomanipoud2 2fa708862d few docstrings 2025-05-22 20:28:57 +02:00
hugomanipoud2 18c659e93d set castling variable done 2025-05-22 20:19:39 +02:00
hugomanipoud2 418d32a7d3 bruh i solved castling without using IA im so hyped rn 2025-05-22 20:13:07 +02:00
hugomanipoud2 425b2696cd maybe almost finished but doesnt work 2025-05-22 20:01:35 +02:00
hugomanipoud2 8ded4954b8 if king or rook moves the castling doesnt work ! 2025-05-22 19:43:17 +02:00
hugomanipoud2 3fb0209a63 all conditions for castling are ok for white king 2025-05-22 19:26:52 +02:00
hugomanipoud2 d37206f77c trying to setup shortcastling 2025-05-22 19:08:26 +02:00
hugomanipoud2 63c51f3d56 input not correct, now works 2025-05-22 17:37:42 +02:00
hugomanipoud2 99c1f81fee created specialMOves class, pawnpromotion doesnt work idk 2025-05-22 17:36:30 +02:00
hugomanipoud2 57d39fff7d now the game only allow selection of pieces if its their turn 2025-05-22 17:13:29 +02:00
hugomanipoud2 61f1b5e83a debugging turnNb, now works correctly 2025-05-22 17:05:45 +02:00
hugomanipoud2 36cdfd1230 all pieces move correctly according to chess rules 2025-05-22 16:20:27 +02:00
hugomanipoud2 9e9e53c8c3 pawn almost finished need some ore work 2025-05-22 16:10:23 +02:00
hugomanipoud2 ac2a23e9a9 pawns cannot go further if a piece is in front of them regardless of
color
2025-05-22 15:42:42 +02:00
hugomanipoud2 95ace3afe1 implementation of is first pawn move to make the method comparable to
others
2025-05-22 15:36:42 +02:00
hugomanipoud2 40bffdbab7 creation of isPAwnMoveValid, implementation of the logic found to black
pawn tooo ishighlighted is now clean
2025-05-22 15:15:42 +02:00
hugomanipoud2 5c27832805 working on pawn movements, removed some spaghetti using the K variable
used on other movement methods
2025-05-22 14:58:28 +02:00
hugomanipoud2 189c7cb218 new method checkColor implemented, code is less spaghetti for king move
and knight move
2025-05-21 19:52:20 +02:00
hugomanipoud2 87aaad73e0 just added isQueenMoveValid as a separate method just in case i need it
for the future, king and knight can be simplified via a helper function,
working on that
2025-05-21 19:35:21 +02:00
hugomanipoud2 1dd328c408 king finished, next are the pawns eating movement 2025-05-21 19:29:55 +02:00
hugomanipoud2 a8c96922a5 knight finished 2025-05-21 19:25:22 +02:00
hugomanipoud2 6787c0eae2 it finnaly works, need to check board getPiece(x,y) instead of
selectedXY because only 1 case is concerned, knight an king soon ok
2025-05-21 19:21:57 +02:00
hugomanipoud2 759930016b i dont even know if thats progress 2025-05-21 18:42:39 +02:00
hugomanipoud2 4ab757eec9 still trying for knight 2025-05-21 18:20:43 +02:00
hugomanipoud2 9c740ee1f0 advancement on knight but still doesnt work 2025-05-21 18:06:24 +02:00
hugomanipoud2 7526532ea4 creation of framework of knightMoves, will add the conditions to not be
able to be on cases that are white
2025-05-21 17:51:31 +02:00
hugomanipoud2 7b01772895 as the moovepool of the queen is one of a rook and bishop combined, an
or operator does the trick !
QUeen finished
2025-05-21 17:33:30 +02:00
hugomanipoud2 d62bdf7ad0 rook finished 2025-05-21 17:30:39 +02:00
hugomanipoud2 b11802b832 arrangement of isHighlighted, the bishop possible movment are now in the
class move, where it should be, the isHighlighted method is more
readable
2025-05-21 17:16:26 +02:00
hugomanipoud2 94858166b9 tostring essai d'amelioration 2025-05-21 16:38:16 +02:00
hugomanipoud2 a3159cc55e bishop done 2025-05-21 14:45:47 +02:00
hugomanipoud2 8dc6c67272 added docstring to explain the ishighlighted method 2025-05-21 14:40:16 +02:00
hugomanipoud2 f3be5c6f6c the code is so spaghetti but it WORKS, need to add docstrings and finish
all pieces
2025-05-21 14:05:06 +02:00