jcchess.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:jcchess 作者: johncheetham 项目源码 文件源码
def go_clicked(self, widget):

        # update time control prior to move
        gv.tc.update_gui_time_control(self.stm)

        # side to move
        self.stm = self.get_side_to_move()

        # start a timer to display the time left while the player is thinking
        gv.tc.start_clock(self.stm)

        if not self.timer_active:
            GObject.timeout_add(1000, gv.tc.show_time)

        gv.gui.disable_menu_items()
        gv.gui.disable_go_button()
        gv.gui.enable_stop_button()

        self.stopped = False

        if gv.verbose:
            print("#")
            print("# " + self.get_side_to_move_string(self.stm) + " to move")
            print("#")

        gv.gui.apply_drag_and_drop_settings(self.player[self.stm], self.stm)

        # gv.board.reduce_board_history(self.movelist)
        self.engine_output.clear("w", " ")
        self.engine_output.clear("b", " ")

        if self.player[self.stm] == "Human":
            gv.gui.set_status_bar_msg(_("ready"))
            return

        gv.gui.set_status_bar_msg(_("Thinking ..."))
        # it's the computers turn to move. kick off a separate thread for
        # computers move so that gui is still useable
        self.ct = _thread.start_new_thread(self.computer_move, ())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号