terminal
- First, open folder
./src
- Second, open a terminal there
- Third, compile
Server.java
, using the commandjavac Server.java
- Fourth, compile
Client.java
, using the commandjavac Client.java
- Fifth, run the
Server.class
, using commandjava Server
- Finally, open two new terminal there and run
Client.class
on each of them, using commandjava Client
- Server communicates with clients solely by socket connection, they do not share information via joint files. Actually, you can put them in different addresses, the program will still work. But for simplicity, I just put them under the same folder.
(All files except
Client.java
in./src
is for Server use.Client.java
is independent.) - Server can continuously support rounds of game. You do not need to terminate it every time one round of game ends. However, Client will automatically close when there is a result. Start Client again each time!
M|string
message that indicates the death of the game, client only needs to slice the ..... part
E|int
message that indicates indicates the result after each move
U|int|int|int
message that instructs client to change the chess
int|int
tell which position was the chess placed
Name input.
a string that indicates the player has input his name