This is the code
GrassFilledX = GrassGenX
GrassFilledY = GrassGenY
GrassFillL = True
while GrassFillL == True:
if gx == hgx or hgx2:
while not crashed:
The error says
while not crashed:
^
IndentationError: expected an indented block
This is the code
GrassFilledX = GrassGenX
GrassFilledY = GrassGenY
GrassFillL = True
while GrassFillL == True:
if gx == hgx or hgx2:
while not crashed:
The error says
while not crashed:
^
IndentationError: expected an indented block
Python expects an indented block after an if
statement.
If you want an empty block, use pass
:
while GrassFillL == True:
if gx == hgx or hgx2:
pass
while not crashed:
This has the same effect in other languages as an empty pair of braces, like if(condition){}
. In Python you're not allowed to leave a block empty, you must at least have an NOP statement, the pass
, in the block, to make the program valid.
This is a similar (yet essentially the same) use case of pass
.