Guide language:

Hello, hello ~ want to share with you a small intelligence game, backgammon, the formation of 5 son to win!

Strategy:

Horizontal as the ridge side into the peak, far and near high and low are different, xiaobian suggestions from different angles. After all, you’re on the outside looking in

The qing dynasty!

Body:

Tools:

Python3.8, pycharm2020

Pycharm2020 can also be run without installing pyCharm2020, but it is better to install pyCharm2020

1. The gobang

Run:

Code:

Class gameStartUI(QWidget): def __init__(self, parent=None, **kwargs): super(gameStartUI, self).__init__(parent) self.setFixedSize(760, 650) self.setwindowIcon (QIcon(cfg.icon_filepath)) # Palette = QPalette() palette.setBrush(self.backgroundRole(), QBrush(QPixmap(cfg.background_imagepaths. Get ('bg_start')))) self. SetPalette (Palette) # button # -- Machine against self 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) # 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) "" 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() def playOnline(self): self.gaming_ui.show() 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. The show () sys. Exit (app. Exec_ ())Copy the code

The end:

If you can’t do it, spend 50 cents to hire someone to help you. After all, there is one more person

A power.

Well, this article ends here ~

Everyone like to remember a little praise, need a complete project source can be private letter I can yo! Or click on this line of blue font!