mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
Update conwaylife.py
Import statements have been moved to the top of the file.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
#import essential libraries
|
||||
import lcd
|
||||
import pyb
|
||||
|
||||
# do 1 iteration of Conway's Game of Life
|
||||
def conway_step():
|
||||
for x in range(128): # loop over x coordinates
|
||||
@@ -37,8 +41,6 @@ def conway_go(num_frames):
|
||||
pyb.delay(300)
|
||||
|
||||
# PC testing
|
||||
import lcd
|
||||
import pyb
|
||||
lcd = lcd.LCD(128, 32)
|
||||
conway_rand()
|
||||
conway_go(1000)
|
||||
|
||||
Reference in New Issue
Block a user