Hello ~ I want to share one with you python Intelligence games , Gobang , formation 5 Child connector wins !

Strategy :

Horizontal as a ridge side into a peak. , The distance is different , Xiaobian suggested looking at Gobang from different angles . After all, those in the game are fans , Watch

Zhe Qing !

<> text :

Use tools :

Python3.8,pycharm2020

You can also not install pycharm2020 It can also be run directly ~ But it would be better to install some

1. Gobang

function :

code :
''' Game start interface ''' class gameStartUI(QWidget): def __init__(self, parent=None,
**kwargs): super(gameStartUI, self).__init__(parent) self.setFixedSize(760,
650) self.setWindowTitle(' Gobang —— Nine Odes ')
self.setWindowIcon(QIcon(cfg.ICON_FILEPATH)) # Background picture palette = QPalette()
palette.setBrush(self.backgroundRole(),
QBrush(QPixmap(cfg.BACKGROUND_IMAGEPATHS.get('bg_start'))))
self.setPalette(palette) # Button # -- Man machine combat self.ai_button =
PushButton(cfg.BUTTON_IMAGEPATHS.get('ai'), self) self.ai_button.move(250, 200)
self.ai_button.show() self.ai_button.click_signal.connect(self.playWithAI) #
-- Online battle self.online_button = PushButton(cfg.BUTTON_IMAGEPATHS.get('online'),
self) self.online_button.move(250, 350) self.online_button.show()
self.online_button.click_signal.connect(self.playOnline) ''' Man machine combat ''' def
playWithAI(self): self.close() self.gaming_ui = playWithAIUI(cfg)
self.gaming_ui.exit_signal.connect(lambda: sys.exit())
self.gaming_ui.back_signal.connect(self.show) self.gaming_ui.show() ''' Online battle '''
def playOnline(self): self.close() self.gaming_ui = playOnlineUI(cfg, self)
self.gaming_ui.show() '''run''' if __name__ == '__main__': app =
QApplication(sys.argv) handle = gameStartUI() font = QFont()
font.setPointSize(12) handle.setFont(font) handle.show() sys.exit(app.exec_())
<> ending :

last , Xiaobian wants to say that if he really can't, he will spend 50 cents to hire someone , Let me show you , After all, there is one more person , More power .

All right , The article ends here ~

Remember to praise what you like , I have a full version here Python A full set of learning materials has been uploaded CSDN, Friends can scan the bottom of wechat if necessary CSDN Official authentication QR code is available for free 【 ensure 100% free 】.

Technology
©2019-2020 Toolsou All rights reserved,
evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possible Experiment 4 Automated test tools - software test mysql Export data sql sentence _mysql according to sql Query statement export data Create a thread ——— Javaweb (3) Data structure experiment ( three )—— Stacks and queues TS stay vue2 Writing in the project web Front end signature plug-in _signature_pad Plug in implements electronic signature function docker Where is the image stored Qt Getting Started tutorial 【 Basic controls 】QCalendarWidget calendar control springboot How to get reality in ip address