![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| If you use floating point numbers in your calculation, Python will compute with decimal points. But when you use them in coordinates, it will only use the integer portion. Mark Guzdial |
Exactly. So for C, think of how you would count it straight: 25, 25 2/3, 26 1/3, 27. Then translate that...
|
def race4Cars():
for car in race(1,5):
for tire in car(1,5):
put tire on the car
print tire
if tire == 4:
"This car is ready to race"
if tire < 4:
"This car needs more tires"
start car
prepare to race
race cars
| Actually, 1/4 of the pixels. It's 1/2 in each direction. Mark Guzdial |