diff options
author | Damien George <damien.p.george@gmail.com> | 2020-02-27 15:36:53 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-28 10:33:03 +1100 |
commit | 69661f3343bedf86e514337cff63d96cc42f8859 (patch) | |
tree | af5dfb380ffdb75dda84828f63cf9d840d992f0f /examples/pyb.py | |
parent | 3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff) | |
download | micropython-69661f3343bedf86e514337cff63d96cc42f8859.tar.gz micropython-69661f3343bedf86e514337cff63d96cc42f8859.zip |
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'examples/pyb.py')
-rw-r--r-- | examples/pyb.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/pyb.py b/examples/pyb.py index b303777e5a..67620e793a 100644 --- a/examples/pyb.py +++ b/examples/pyb.py @@ -1,17 +1,22 @@ # pyboard testing functions for CPython import time + def delay(n): - #time.sleep(float(n) / 1000) + # time.sleep(float(n) / 1000) pass + rand_seed = 1 + + def rng(): global rand_seed # for these choice of numbers, see P L'Ecuyer, "Tables of linear congruential generators of different sizes and good lattice structure" rand_seed = (rand_seed * 653276) % 8388593 return rand_seed + # LCD testing object for PC # uses double buffering class LCD: @@ -30,12 +35,12 @@ class LCD: self.buf1[y][x] = self.buf2[y][x] = value def show(self): - print('') # blank line to separate frames + print("") # blank line to separate frames for y in range(self.height): for x in range(self.width): self.buf1[y][x] = self.buf2[y][x] for y in range(self.height): - row = ''.join(['*' if self.buf1[y][x] else ' ' for x in range(self.width)]) + row = "".join(["*" if self.buf1[y][x] else " " for x in range(self.width)]) print(row) def get(self, x, y): |