daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while king_alive:
  2.     global bot_turn
  3.     if bot_turn:
  4.         cells = l.bot_move(log_field)
  5.         print(cells[0].x, cells[0].y, cells[1].x, cells[1].y)
  6.         replace(cells[0], cells[1])
  7.         bot_turn = False
  8.    
  9. def replace(first_cell, second_cell):
  10.     if second_cell.figure.type != 'nofig':
  11.         delete_fig(second_cell.figure)
  12.     first_cell.clicked = False
  13.     second_cell.clicked = False
  14.     second_cell.fig_name = first_cell.fig_name
  15.     second_cell.fig_owner = first_cell.fig_owner
  16.     second_cell.figure = second_cell.get_figure()
  17.     first_cell.figure = l.NoFigure(first_cell.x, first_cell.y, "")
  18.     first_cell.fig_name = ""
  19.     first_cell.fig_owner = ""
  20.     field[second_cell.x][second_cell.y].configure(fg=second_cell.fig_owner, text=second_cell.fig_name)
  21.     field[first_cell.x][first_cell.y].configure(text="")
  22.  demark_cells()
  23.    
  24. Traceback (most recent call last):
  25.   File "C:/Users/Даша/Desktop/python/task chess/graphics.py", line 176, in <module>
  26.     main()
  27.   File "C:/Users/Даша/Desktop/python/task chess/graphics.py", line 171, in main
  28.     replace(cells[0], cells[1])
  29.   File "C:/Users/Даша/Desktop/python/task chess/graphics.py", line 138, in replace
  30.     field[second_cell.x][second_cell.y]['fg'] = second_cell.fig_owner
  31.   File "C:Python34libtkinter__init__.py", line 1275, in __setitem__
  32.     self.configure({key: value})
  33.   File "C:Python34libtkinter__init__.py", line 1268, in configure
  34.     return self._configure('configure', cnf, kw)
  35.   File "C:Python34libtkinter__init__.py", line 1259, in _configure
  36.     self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
  37.   _tkinter.TclError: invalid command name ".36689776"
RAW Paste Data
Top