Skip to content

Commit b94a209

Browse files
author
ugurthemaster
committed
Update conwaylife.py
Import statements have been moved to the top of the file.
1 parent 39763c6 commit b94a209

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/conwaylife.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#import essential libraries
2+
import lcd
3+
import pyb
4+
15
# do 1 iteration of Conway's Game of Life
26
def conway_step():
37
for x in range(128): # loop over x coordinates
@@ -37,8 +41,6 @@ def conway_go(num_frames):
3741
pyb.delay(300)
3842

3943
# PC testing
40-
import lcd
41-
import pyb
4244
lcd = lcd.LCD(128, 32)
4345
conway_rand()
4446
conway_go(1000)

0 commit comments

Comments
 (0)