- Invite a friend using his IP and port number
(shoud be open and the friend accept your invitation) - Listen to a friend
(bind socket to an interface with IP, specify a port number)
(Who listens will play first with white color) - History (Not implemented yet)
(view past mathches results)
option: play the match
There are 2x16 pieces on the board, init there types and locations
In the start of each play check the king status:
-
other player lose?
- I win and break
- I win and break
-
Other player draw?
- I draw and break
- I draw and break
-
try for each of your pieces every available move
and check if the king will be safe or not.- King is not safe?
- A move found to disable check ?
- YES ? -> checkmate
- NO ? -> send lose and break
- YES ? -> checkmate
- A move found to disable check ?
- king is safe?
- Any valid move found?
- YES ? -> good
- NO ? -> send draw (stalemate) and break
- YES ? -> good
- Any valid move found?
- King is not safe?
- YES? do(A)
- NO? do (B)
(A) Make a move
How to check a move if it's valid?
- Not out of bound of the chess board.
- Not an empty spot.
- Not moving enemy's piece
- Castling
- valid ?
- do castling and update board
- do castling and update board
- not valid ?
- print "not valid"
- print "not valid"
- valid ?
- Not attacking allied piece.
- Valid piece range
valid ?
- try to make the move
- is king safe ?
- No ?
- roll back the move and print "not valid"
- goto(4)
- roll back the move and print "not valid"
- Yes ?
- update the board with the valid move, send the move and change the turn.
- goto(3)
- update the board with the valid move, send the move and change the turn.
- No ?
(B) recive other player's reply
recive move
- move is -1 ?
- other player lose (I win)
- other player lose (I win)
- move is -2 ?
- other player draw (I draw)
- other player draw (I draw)
- else
- update the board and change the turn
- goto(3)
- update the board and change the turn
History feature (not implemented yet)
- This game doesn't detect all draw cases (just stalemate)
Any PR handling a game draw case will be reviewed and accepted - Any special moves (rather than pawn promotion and castling)
-Any Chess rules not coverd-
inclue the rule reference in your PR
- History
- GUI
- chat (Threading)
- Timer (Threading)
- Chess agent (API)
- Chess engine (AI)