10 步:让我们计算左上角第一个正方形的 x 坐标。

  • create_maze()的 for 循环中,将=符号左侧的变量从my_varx
  • 将数字2更改为 - 250并将数字3更改为square_length / 2
  • 我们使用正方形的中心坐标放置正方形,因此我们将正方形长度的一半添加到 - 250 。此外,我们将此代码放在我们的第一个 for 循环中,因此x会刷新每一行。

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)