Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
b94a209d
Commit
b94a209d
authored
11 years ago
by
ugurthemaster
Browse files
Options
Downloads
Patches
Plain Diff
Update conwaylife.py
Import statements have been moved to the top of the file.
parent
39763c6c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/conwaylife.py
+4
-2
4 additions, 2 deletions
examples/conwaylife.py
with
4 additions
and
2 deletions
examples/conwaylife.py
+
4
−
2
View file @
b94a209d
#import essential libraries
import
lcd
import
pyb
# do 1 iteration of Conway's Game of Life
# do 1 iteration of Conway's Game of Life
def
conway_step
():
def
conway_step
():
for
x
in
range
(
128
):
# loop over x coordinates
for
x
in
range
(
128
):
# loop over x coordinates
...
@@ -37,8 +41,6 @@ def conway_go(num_frames):
...
@@ -37,8 +41,6 @@ def conway_go(num_frames):
pyb
.
delay
(
300
)
pyb
.
delay
(
300
)
# PC testing
# PC testing
import
lcd
import
pyb
lcd
=
lcd
.
LCD
(
128
,
32
)
lcd
=
lcd
.
LCD
(
128
,
32
)
conway_rand
()
conway_rand
()
conway_go
(
1000
)
conway_go
(
1000
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment