Skip to content

kerong2002/Gobang_Socket

Repository files navigation

Gobang


Server

Client

TCP structure

UDP structure
  • Starting the game requires two parameters, the IP address of the host and the port number.
  • For example, you can start the game with the following command:
python Gobang_server.py <ip_address> <port_number>
python Gobang_client.py <ip_address> <port_number>
# example:
python Gobang_server.py localhost 1234
python Gobang_client.py localhost 1234
  • In the game, black moves first. You can place a piece by clicking on a position on the board with your mouse. When it is your turn to move, a prompt will appear on the screen indicating that it is your turn.

  • During the game, you can right-click on the board to view the game rules and to surrender. When a player wins or surrenders, the game will end and both players will be prompted to play again.

  • That's it! Enjoy playing Gobang via UDP socket.