diff --git a/screen.c b/screen.c index e8e81b1..6779d2c 100644 --- a/screen.c +++ b/screen.c @@ -57,11 +57,11 @@ struct coord randomCoord(WINDOW * win){ struct coord res = {rX, rY}; - if (mvwinch(win, res.y, res.x) == ' '){ - return res; - } else { + if (mvwinch(win, res.y, res.x) != ' '){ randomCoord(win); } + + return res; } void generarElefantes(WINDOW * win, struct coord *buff){ @@ -169,4 +169,3 @@ int screen() { return 0; } -