[Pyhon] 成發-Gobang
時隔這麼久,我終於停止耍廢了(X 為了高二的成發,所以我花了這幾天學了下tkinter,然後寫了一個PvP的五子棋遊戲出來了,嗯嗯,反正也沒有甚麼技術成分,只是有時候把_打成i然後de了半小時的code之類的,sad,總之最後弄出來了啦XD,有想過要弄得很精美,不過我有好多障礙所以還是算了,背景色有點糟糕,可能會再調吧,總之,嗯,就這樣吧。 下面附上code,猜到了嗎?對! 就是這不是用C++寫的喔>_< import tkinter as tk import tkinter.messagebox import numpy as np class Chess_Board (): def __init__ (self): self.start_X = 200 self.start_Y = 150 self.board_width = 30 self.board_num = 19 self.board_line_width = 2 self.piece_size = 10 self.canvas_width = 1024 self.canvas_height = 876 self.window = tk.Tk() self.window.title( 'Gobang' ) self.window.configure(bg = '#bb5e00' ) #self.window.geometry('1400x968') self.count = 0 self.win_num = 5 self.canvas = tk.Canvas(self.window,bg = '#bb5e00' ,width = self.canvas_width, height = self.canvas_height) self.element = []