相关疑难解决方法(0)

移动椭圆形的棋盘代码

我正在为大学做一个python跳棋游戏.我使用tk绘制了电路板,但我似乎无法为这些部件实现移动功能.如果有人在我的代码中看到任何错误,或者可以提供帮助,我将不胜感激.这是完整的来源.提前致谢.

我知道这会吸引棋子.我不知道如何重新绘制碎片,而不删除其他碎片.我已经在线查看了移动功能,并尝试了简单的测试,但我无法在我的代码中使用它.

我知道递归,但是,在实现更多功能之前,我需要基本功能才能工作,即实际在屏幕上移动一块.

lst2 = []

#counter variable
i=0

#board variable is what stores the X/O/- values.
# It's a 2D list. We iterate over it, looking to see
# if there is a value that is X or O. If so, we draw
# text to the screen in the appropriate spot (based on
# i and j.
while i < len(board):
  j=0
  while j < len(board[i]):

    if board[i][j] == 2:
      lst2.append(canvas.create_oval((i+1)*width + width/2 + 15,
        (j+1)*height + height/2 …
Run Code Online (Sandbox Code Playgroud)

python tk-toolkit tkinter python-2.7

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

python ×1

python-2.7 ×1

tk-toolkit ×1

tkinter ×1