Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Spring 2007 Homework 2 Questions

Edit Spring 2007 Homework 2 Questions here.

Please enter your question in the box at the bottom of the page so that everyone sees it and can answer it.
When entering code, surround it with <code> and </code> This ensures it is laid out correctly. Colin Potts

In my definition for scaleDown, i have that targetPixel= getPixel(target, targetX, targetY) and in the next couple of lines I have that taretY= targetY+1 and targetX= targetX+1 (these not being on the same lines). The spacing and indenting are the same as used in class, but jes keeps saying that y(=301) is less than 1 or bigger than the height (=300) and it says to change the line targetPixel+get.... I don't know how to fix the line to make it work.
This is nothing to do with spacing or indentation. The problem is that you are trying to change a pixel that doesn't exist because your picture isn't big enough. (It is only 300 pixels high). Is this where you are copying the flowers? If so, try starting targetY with a lower number. It will appear a bit higher up in the picture. Send a TA your code or go to someone's office hours if this doesn't make sense. Colin Potts

I am having the same problem. I copied the code and setMediaPath but Jes still tells me that the names cannot be found globally and I have loaded my code numerous times.
Make sure that all your pictures are in the same folder and you choose that when you run the function. If you still have problems, email a TA with your code and the lines of code you used to run the function. - Bobby Mathew

I can't get past the beginning of the homework. I copied the
def hw2():
  imageA = makePicture('imageA.jpg')
  imageB = makePicture('imageB.jpg')
  imageC = makePicture('imageC.jpg')

code and did setMediaPath(), however Jes tells me that image names cannot be found globally.
All the errors you are reporting (this one and the ones below) sound as though you are not loading your code. Hit the load button. Colin Potts

The makeLighter and makeDarker functions won't work on my JES. I copy the code exactly from the book but it says there is always an error with makeLighter or makeDarker. What should I do?
Help us help you by saying exactly what the error is. Colin Potts

I cannot get the distance function to work on JES. The error message says "Name not found globally.
A local or global name could not be found. You need to define the function or variable before you try to use it in any way.
Please check line 39 of C:\Documents and Settings\Owner\My Documents\School Work Spring 2007\CS 1315\hw2.py"
How can I fix this?
I posted several announcements about distance() last week. There was a bug that has been fixed. You should download JES 3.0 again if the above solution doesn't work. Colin Potts

I was successful in copying the sun to imageC. I tried to use the same code (changing the target and source ranges) but nothing happens. This code obviously worked on the sun, and the only difference with the car is the range. So...what now? I feel like i've tried everything! Please help! I'm at my wits end!
It should work if you got the sun to copy over. Check the code with what was given in lecture and make sure you repain the picture after it copies, so you can see the changes. - Bobby Mathew

What will the TAs be typing into the command area when checking the homework assignment?
We will add a show(finalImage) statement at the end of the code if it isn't already there and then type setMediaPath() and hw2() in the black area. - Bobby Mathew

i have some small random boxes of cyan pixels surronding my sun clouds and tire tht wont get colored is this norm? if not what should i do?
That's fine. - Bobby Mathew

when doing the addRectFilled for the windows, how do I input the color into the function?
addRectFilled(pic, startX, startY, width, height, makeColor(r, g, b)) - Bobby Mathew

when I try to scale the sun up, the program turns it into a line instead.
what does the error "zero for range()" mean?