Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

wctjerry

  • 3 years ago

when doing ps6, I met with some difficulty with setRobotPosition of class Robot. Is it OK just add one line 'self.position = to position' ? I wrote some test codes to show it briefly. Let's have a look. http://pastebin.com/LfKh8mad In setPosition method, self.position should be updated but it didn't. It puzzles me a lot. Someone knows why ?

  • This Question is Open
  1. bwCA
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    u didn't do that in BaseRobot?

  2. bwCA
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i had a hunch - don't know why maybe some circular referencing going on?? this seems to work - i change the argument names http://dpaste.com/816471/

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy