擅长:python、mysql、java
<p>我相信问题出在你的随机球员课上。您应该返回与该索引相关的移动,而不是在move方法中返回索引。换句话说,你的RandomPlayer类应该是:</p>
<pre class="lang-py prettyprint-override"><code>
class RandomPlayer(Player):
def move(self):
index = random.randint(0, 2) # Selects random moves from the move list
return moves[index] # Changed from return (index)
</code></pre>