nuno-faria / tetris-ai

A deep reinforcement learning bot that plays tetris
MIT License
260 stars 67 forks source link

Fix the bug in _clear_lines function #1

Closed nlinker closed 5 years ago

nlinker commented 5 years ago

The bug can be illustrated like this:

xs = list(range(10))
for index, x in enumerate(xs):
    if 2 <= x <= 4:
        del xs[index]
print('xs=', xs)  # outputs xs= [0, 1, 3, 5, 6, 7, 8, 9]

The same is here.

nuno-faria commented 5 years ago

Thank you for your interest in this project. Could you please make the pull request with just the bug fix?

nlinker commented 5 years ago

@nuno-faria Yep, I've made the PR to contain only the bug this.