You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
544 B
27 lines
544 B
1 year ago
|
from listwork import *
|
||
|
from random import randint as ri
|
||
|
|
||
|
# pas2( fill(...) ) -> 1/2
|
||
|
def pas2(packed):
|
||
|
unpacked = unpack(packed["main"])
|
||
|
new_pxls = []
|
||
|
|
||
|
pas = False
|
||
|
for i in unpacked:
|
||
|
if not pas:
|
||
|
new_pxls.append(i)
|
||
|
pas = True
|
||
|
else:
|
||
|
pas = False
|
||
|
packed = {"main": pack(new_pxls)}
|
||
|
return packed
|
||
|
|
||
|
# rand(x1,y1, x2,y2) -> draw() or pas2()
|
||
|
def rand(x1,y1, x2,y2):
|
||
|
pxls = []
|
||
|
for x in range(x1, x2 +1):
|
||
|
for y in range(y1, y2 +1):
|
||
|
pxls.append([x,y, ri(0,255), ri(0,255), ri(0,255)])
|
||
|
packed = {"main": pack(pxls)}
|
||
|
return packed
|