Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python Program help

Name: Anonymous 2011-10-12 16:54

Can someone list all the syntax and semantic errors in the following program. It's in Python/Jython.

def flag(size):
  pic = makeEmptyPicture(size, size)
  for x in range(size):
    for y in rage(size):
    pix = getPixel(pic, x, y)
      #make the upper left black
      if y <= (.5 * size) and x <= (.5 * size)
        setColor(pix, black)
      #make the upper left black
      if y <= (.5 * size) and y <= (.5 * size):
        setColor(pix, orange)
  return pic

Name: Anonymous 2011-10-12 17:07

fuck you fag

Name: Anonymous 2011-10-12 17:13

why?

Name: Anonymous 2011-10-12 17:20

you are missing a lot of semicolons

Name: Anonymous 2011-10-12 17:24

I'm running JES and I'm trying to figure it out myself. could tell me what lines i'm missing semicolons in?

Name: Anonymous 2011-10-12 18:13

please someone help. i tried to load it in JES and line 5 has a syntax error, but i cant find it.

Name: Anonymous 2011-10-12 18:45

bump

Name: Anonymous 2011-10-12 19:40

bump

Name: Anonymous 2011-10-12 19:46

Line 5 missing 2 leading spaces.
Line 7 missing the trailing colon.

def fag(size):
  pic = makeEmptyPicture(size, size)
  for x in range(size):
    for y in rage(size):
      pix = getPixel(pic, x, y)
      #make the upper left black
      if y <= (.5 * size) and x <= (.5 * size):
        setColor(pix, black)
      #make the upper left black
      if y <= (.5 * size) and y <= (.5 * size):
        setColor(pix, orange)
  return pic

Name: Anonymous 2011-10-12 20:12

>>1
Stop being retarded

Name: Anonymous 2011-10-12 20:29

>>9
You still forget a typo.

Name: Anonymous 2011-10-12 20:34

no, i see the program is named "fag" instead of "flag" and I'm gonna fix the rest of it too.

Name: Anonymous 2011-10-12 20:36

>>10
Wow, man. Did you ever think that I'm just starting out with computer programming?

Name: Anonymous 2011-10-12 20:50

>>12 consider fag is a hint for rage.

Name: Anonymous 2011-10-12 22:12

mate... you got a lot of work ahead of you if you couldn't do this.

Name: Anonymous 2011-10-13 4:10

All of my rage.

Don't change these.
Name: Email:
Entire Thread Thread List