12 步:游戏快到了,但它有一个棘手的逻辑错误需要我们修复!

  • 运行游戏并输入错误。当你不止一次地猜r时会发生什么?我们被告知r是一个正确的字母,但没有显示单词error中的额外r 。让我们开始解决这个问题!
  • ,在 if 块中添加Set Value at Index 。确保它缩进两次!
  • 将列表索引分配更改为word_list [ letter_index ] = letter_guess

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)