In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use python pygame to achieve Gobang online". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use python pygame to achieve Gobang online.
In the same local area network, when the server is turned on, another machine changes the IP address HOST to the IP address corresponding to the server, and the port number is consistent with that of the server. (IP address query method: enter cmd,cmd window in the menu bar, enter ipconfig to find the IPv4 address under the wireless network)
Server:
#-*-coding: utf-8-*-"Created on Tue Jun 8 14:03:09 2021@author: Administrator"import pygameimport sysfrom pygame.locals import * from collections import Counterfrom socket import * from timeimport ctimeimport jsonimport selectimport socket# interface initialization screen=pygame.display.set_mode ((400450)) pygame.display.set_caption ('Gobang') pygame.init () # Image Import img_board=pygame.image.load ('F:/images/ Gobang / chess_board. Png') img_bchess=pygame.image.load ('F:/images/ Gobang / black_chess.jpg') img_wchess=pygame.image.load (' F:/images/ Gobang / white_chess.jpg') # Color white= (255255255) black= (0L0 0) # data used for transmission msg= [] # Checkerboard definition chess_board= [[]] def set_chess_board (): XQuery Yizhao 0 while True: if Xerox 40 if y
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.