第 6 步:让我们施放火球术!只有当用户选择一个 或者计算机随机选择"a"

  • cast_spell()中找到if语句。用这个函数调用替换第一遍pass fireball( caster )

fireball()函数还需要知道是谁施法的,所以我们将caster精灵传递给它,以便该函数知道将火球扔到哪里!

  • 点击现在运行并选择选项a来施放火球术!

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)