Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
SIDESTICK = False
|
||||
|
||||
def setup() :
|
||||
global is_taken
|
||||
size(512, 512)
|
||||
background(0)
|
||||
is_taken = [[False] * height for _ in range(width)]
|
||||
is_taken[width/2][height/2] = True
|
||||
|
||||
|
||||
def draw() :
|
||||
x = floor(random(width))
|
||||
y = floor(random(height))
|
||||
if is_taken[x][y]:
|
||||
return
|
||||
while True:
|
||||
xp = x + floor(random(-1, 2))
|
||||
yp = y + floor(random(-1, 2))
|
||||
is_contained = 0 <= xp < width and 0 <= yp < height
|
||||
if is_contained and not is_taken[xp][yp]:
|
||||
x = xp
|
||||
y = yp
|
||||
continue
|
||||
else:
|
||||
if SIDESTICK or (is_contained and is_taken[xp][yp]):
|
||||
is_taken[x][y] = True
|
||||
set(x, y, color(255))
|
||||
break
|
||||
|
||||
if frameCount > width * height:
|
||||
noLoop()
|
||||
Loading…
Add table
Add a link
Reference in a new issue