I'm trying to make a chess application with java swing and tcp socket for my school project. But I still have some problems. Please help me out.
1. Should I put the clock for each player on server side or client side?
2. What is effective way to detect a checkmate? I can detect a check by checking all the square on the king's column, row, etc. But I dont think this way can detect a checkmate.
3. One again, where shoud i put the checkmate detector? If a player clicks on a piece, the client side will find all legal moves and display it. Shoud I put the checkmate detector somewhere here?
Sorry for my bad english.
Only way to detect checkmate in a program is if you simulated every move, concluded none are legal & the king is in check.
You run this once per move, and it detects checkmate and stalemate ( if the king is not in check and no legal moves then stale )
I'm trying to make a chess application with java swing and tcp socket for my school project. But I still have some problems. Please help me out.
1. Should I put the clock for each player on server side or client side?
2. What is effective way to detect a checkmate? I can detect a check by checking all the square on the king's column, row, etc. But I dont think this way can detect a checkmate.
3. One again, where shoud i put the checkmate detector? If a player clicks on a piece, the client side will find all legal moves and display it. Shoud I put the checkmate detector somewhere here?
Sorry for my bad english.