# Noises seem to work, but test cases won't budge...

 0 I am stuck. It seems like my functions move and sense both work well! Yet, I cannot seem to get either of the two test cases to work. Below is how I tried to test my functions, and below that is the output I got. It seems right to me. Yet, my code doesn't work when I run it in either of the two test cases. After hours and hours I need a hint or some feedback. From what is below, does it seem like my functions are working correctly? (I am new to python and programming in general) MY TEST: r = robot() print r r.set_noise(bearing_noise, steering_noise, distance_noise) print r.sense(0) print r.sense() r.move([pi/8.0,10]) print r print r.sense(0) print r.sense() THE OUTPUT: [x=98.539 y=72.225 orient=2.9426] [1.789941734142201, 0.83143434899682944, 6.2073800961397936, 4.858777250229493] [1.9061385508961166, 0.87548989086415929, 0.27913135700035602, 4.7692528026139129] [x=82.396 y=73.891 orient=3.1348] [1.8114322113021917, 0.73779931010396638, 5.9830996144865036, 4.1259231987578717] [1.76619478266442, 0.72160124078836407, 5.8582556808143087, 4.1367433229995934] To me it seems like all three noises are working correctly. Is that correct? And if so, how come the test cases don't work, if all we have to do is correctly implement the noises into the move and sense functions? Thank you so much for your help! asked 11 Mar '12, 01:07 Alex Heaton 68●2●10 accept rate: 0%

 1 Taking a quick look at the output, you are moving the robot a distance of 10 but the x coordinate has moved by approx 16. You should check your move function. answered 11 Mar '12, 01:16 david radnell 144●1●3
 1 Don't forget that r.move() should return a new robot rather than modifying the existing one. When you do that, you should make sure that the newly created robot has the same properties as the old one (length and noise values). I'd start by checking that... answered 11 Mar '12, 01:20 Matt Bell 2.1k●3●13●42 Yep. That was it. I am now going to think about why that matters, because I don't quite understand that. Thank you so much for the help. (11 Mar '12, 01:29) Alex Heaton
Question text:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

×5,185
×183
×37