3 ms·
As other comments have noted, it's easy to get this implementation into a state where it throws "S" pieces at you over and over. It would be better if it used
by mayoff 5y ago
As other comments have noted, it's easy to get this implementation into a state where it throws "S" pieces at you over and over.
It would be better if it used a variant of the Random Generator algorithm, which guarantees an equal distribution of pieces.
https://tetris.fandom.com/wiki/Random_Generator https://tetris.fandom.com/wiki/Random_Generator
Lovetris should choose, from the remaining pieces in the current bag, the one that it thinks is "best".