mirror of
https://github.com/c0de-archive/pixoPython.git
synced 2024-12-21 13:02:40 +00:00
Improve Efficiency - Pixo.transition_image_random
Don't change the destination pixel if it is already what it should be in the image
This commit is contained in:
parent
4eef181fa9
commit
3787d7bae0
@ -126,7 +126,7 @@ class Pixo:
|
|||||||
already_changed = []
|
already_changed = []
|
||||||
while len(already_changed) < TOTAL_DOTS:
|
while len(already_changed) < TOTAL_DOTS:
|
||||||
dot = random.randrange(0, TOTAL_DOTS)
|
dot = random.randrange(0, TOTAL_DOTS)
|
||||||
if dot not in already_changed:
|
if dot not in already_changed and not BOARD[dot] == image[dot]:
|
||||||
already_changed.append(dot)
|
already_changed.append(dot)
|
||||||
|
|
||||||
BOARD[dot] = image[dot]
|
BOARD[dot] = image[dot]
|
||||||
|
Loading…
Reference in New Issue
Block a user