Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 18 Online
OpenStudy (anonymous):

I am extremely behind on the fall course - just now doing Homework 4 and then moving to the tetris project - anyone have working code for getting the wheel to animate in 4.1.3?

OpenStudy (anonymous):

@susanjrobertson, glad to see you are still working. The third sequence is just about at this point now, so there should be some folks working on this problem from that group about now. Ping me if you don't get an answer some time relatively soon.

OpenStudy (anonymous):

hi susan, the mooc-e suggested i work with you as we are at the same place. i've posted the wheel code at github https://gist.github.com/davekpython/4698027. i'm now trying to build the car and having little luck. thoughts? dave

OpenStudy (anonymous):

@dave - thanks for posting this. I'm still working through getting the wheel to animate - I'm getting errors in idle when I run the code, the biggest one telling me that 'after' isn't defined. So I'm still trying to get this working. Hopefully I'll have some time today :)

OpenStudy (anonymous):

i just added a cleaner version of wheel https://gist.github.com/davekpython/4715546 i used to get that after comment as well. this one animates on my idle.

OpenStudy (anonymous):

@davek - thanks so much for this, I think I understand what is going on here and am moving on to the car - we'll see what happens :)

OpenStudy (anonymous):

let me know how the car goes. i can create a car with definitions but am having trouble creating a car class and within it, making the car and animating it.

OpenStudy (anonymous):

I'm having a lot of trouble with classes still and how they work. I did find another question on there which linked to an animated car, but didn't want to just look at an answer. I'm actually going back to the MIT course and watching the lecture on classes (was never assigned in the MOOC) to see if that helps me understand more.

OpenStudy (anonymous):

good idea. i'll take a look too. the mooc class seems to drop the ball at week 7.

OpenStudy (anonymous):

yeah - lecture 10 starts with exceptions, classes and iterators about 20 minutes in.

OpenStudy (anonymous):

cool. thanks.

OpenStudy (anonymous):

@davek So I watched quite a bit more lecture and I figured out the car.py and the next one the Blocks to begin the tretrominoes.py file - I admit I did look for some help online, but it's making a bit more sense to me. Let me know if you want to see the code and I'll make a gist of it. I also think the MOOC definitely should have included more lectures for these exercises - it's a big leap from week 6 to week 7 without the lecture I think.

OpenStudy (anonymous):

great. i'm just finishing up the recitation 5 (very good after minute 30). the lecture was good as is the recitation. clarifying a lot. i'm going to try to code it after. i'm guessing i'm going to need some help but we'll see. well done.

OpenStudy (anonymous):

yup, i'm stuck at drawing the rectangle. any chance i can look at the code?

OpenStudy (anonymous):

Here's a gist of my car.py - https://gist.github.com/susanjrobertson/4728527 I agree with you that lecture 10 and 11 and also recitation 5 was super helpful. I also took a good look at the graphics.py to understand what classes were in there that I could use in the car.py. It's also heavily used in the Blocks exercise.

OpenStudy (anonymous):

Wow. Great! got it, but i needed to peak a few times. my use of self. was throwing me off and combining stuff from both graphic and wheel in same def makes all the sense. thank you.

OpenStudy (anonymous):

also like the if y<0. didn't use it but can see why it could and probably will be useful soon enough.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!