Posted: Mon Feb 27, 2012 12:02 pm Post subject: help with a While loop...invalid syntax?
Im having trouble with a While loop inside an if statement. I keep getting an error: invalid syntax at battleNotdone. I want the code to see who goes first, and loop the turns starting with that person. there is code in the functions to give battleNotdone a value ending the loop.
I am new to python, and im not sure whats going on here. ive searched and found nothing online. I can post the whole program if that would help. Im trying to make a program to imitate a battle. its loosely based on DnD and the d20 system. It started as a test of my beginner skills and keeps evolving to be slightly more complex.
code:
battleNotdone = 0
if playerRoll > enemyRoll:
print player.name, "goes first", "\n"
While battleNotdone == 0:
yourTurn()
enemyTurn()
Sponsor Sponsor
Dreadnought
Posted: Mon Feb 27, 2012 12:13 pm Post subject: Re: help with a While loop...invalid syntax?
Most keywords do not have the first letter capitalized. In this case, "While" should be written "while".
Joeltron
Posted: Mon Feb 27, 2012 12:30 pm Post subject: Re: help with a While loop...invalid syntax?
Thank you very much. such a little detail, good eye!