complete brain fart, it doesn't loop

Martin S shieldfire at gmail.com
Sun Jul 27 13:53:20 EDT 2014


I have this snippet in my web application. Question is why doesn't the
stupid thing loop ten times? It loops exactly 1 time.

  # Reset counter
    counter = 0


    while counter <= 10:
        #if test != '':
        tourn=games[counter][0]
        round=games[counter][1]
        date=games[counter][2]
        opponent=games[counter][3]
        oppRating=int(games[counter][4])
        oppElo=int(games[counter][5])
        res=games[counter][6]

        eloChange=float(Elocalc(myElo,oppElo,modifierK,res))

        if myRating > oppRating:
            HL='H'
            rdiff=myRating-oppRating
        else:
            HL='L'
            rdiff=oppRating-myRating
        result=res+HL

        #Call function
        if myRating <=2199:
            rchange=LASKcalc(rdiff, result)
        else:
            rchange=LASKcalc(rdiff, result)/2

        if res == '1':
            verbalres='win'
        elif res== '=':
            verbalres='draw'
        else:
            verbalres='loss'


        return "<p>Long line with games</p>"

        counter=counter+1

-- 
Regards,

Martin S



More information about the Python-list mailing list