#Problem with neat AI
15 messages · Page 1 of 1 (latest)
Here's a list of pastebin alternatives that don't suck.
https://gist.github.com
https://paste.pydis.com
https://mystb.in
For large projects, use https://github.com
If you're popping items from the list while iterating, you end up shifting all the indexes and you skip birds and try to pop indexes that don't exist anymore
The first thing I can think of is creating a copy of your list, and deleting items from the copy instead of the original - but that isn't space efficient
What are you trying to do exactly?
That's ok - everyone starts somewhere - although I don't think going straight into AI is a good idea
for bird in birds:
if bird.y + bird.img.get_height() > 730 or bird.y < 0:
birds.pop(x)
nets.pop(x)
ge.pop(x)
Your problem is in this bit of code.
x isn't defined anywhere here - it's using the last x from your other loop above so you end up removing the wrong bird
Line 248
I'm assuming you're making a model that trains a flappy bird - if it hits a pipe or goes too low or high then the bird is not successful
I'm not 100% sure if that iterates correctly but glad I could help resolve at least one issue 🙂
Uh I think keeping things on this server would be better
You can chat to me in any of the channels 
I'm from the UK