第 4 步:让我们通过创建一个新函数开始制作我们的迷宫。

  • 该函数需要一个参数——行数和列数相等的二维列表。
  • ,在上面写着: MAIN FUNCTION的地方拖入Define Function with Docstring
  • my_function重命名为create_maze并在( )中键入maze
  • 最后,将您的文档字符串更改为以下内容: """ Creates the maze using square sprites """

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)