Bird
0
0

A Game class method play_turn() calls player.make_move() but the player's position never changes. Which fix is most appropriate?

medium📝 Analysis Q7 of 15
LLD - Design — Tic-Tac-Toe Game
A Game class method play_turn() calls player.make_move() but the player's position never changes. Which fix is most appropriate?
ACall board.update_position() inside make_move()
BEnsure make_move() updates self.position correctly
CAdd a return statement to make_move()
DReset player position before calling make_move()
Step-by-Step Solution
Solution:
  1. Step 1: Identify cause of no position change

    Likely make_move() does not update self.position attribute.
  2. Step 2: Evaluate fixes

    Adding return or resetting position won't fix update; calling board method is design choice but not direct fix.
  3. Final Answer:

    Ensure make_move() updates self.position correctly -> Option B
  4. Quick Check:

    Position update must happen inside make_move() [OK]
Quick Trick: Update player position inside make_move() [OK]
Common Mistakes:
MISTAKES
  • Thinking return fixes state change
  • Resetting position unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes