mardi 6 décembre 2016

Python: Why am I getting an "expected an indented block" on elif (r <= 9):

I can't seem to figure out where I formatted this python code incorrectly. I've made sure that the indentions are correct, but I have no idea why this error is occurring. What am I missing here?

width = passageWidth(checkChamber, chamberMaxLength)
if (width >= 10):
    point = width/2
else:
    width = 2
r = random.randint(1, 19) #think aboout adding stairs later!!!
if (r <= 14):
    if (r == 5):
        door(False, 0) #continue 20, end door
    elif (r == 10):
        x = random.randint(1, 10)
        if (x == 1):
            door(False, -1) #continue 20, secret door
        else:
            #continue 20, dead end
    elif (r <= 9): ########### Error occurs here ##############
        if (r <= 6):
            if (r <= 2):
                #continue 30
            elif (r == 3):
                door(False, 0) #continue 30, door right at 20
            elif (r == 4):
                door(False, 0) #continue 30, door left at 20
            else:
        elif (r >= 6):
            if (r >= 8):
                passage(False, 0) #continue 30, passage left at 20
            else:
                passage(False, 0) #continue 30, passage right at 20
        else:
    elif (r <= 12):
        #continue 20 plus point, turn left, continue 10 plus point
    else:
        #continue 20 plus point, turn right, continue 10 plus point

    #offset edges along passage by point value to define sides of passage
elif (r <= 19):
    #create Chamber
else:
    #stairs

#Check if space is available, if not, terminate!

Aucun commentaire:

Enregistrer un commentaire