diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-06 22:13:00 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-07 22:51:08 +0000 |
commit | 1a9951d5aab681a4ff408d8520696b9f67b83d49 (patch) | |
tree | bd45b157eade73033cad4eb1336ec5357f881743 /examples | |
parent | be8fe5be2eb89cd8db741b16dcb50bf5966c33ae (diff) | |
download | micropython-1a9951d5aab681a4ff408d8520696b9f67b83d49.tar.gz micropython-1a9951d5aab681a4ff408d8520696b9f67b83d49.zip |
py: Fix up number operations and coercion.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/mandel.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/mandel.py b/examples/mandel.py new file mode 100644 index 0000000000..b13b7d87f8 --- /dev/null +++ b/examples/mandel.py @@ -0,0 +1,14 @@ +@micropython.native +def in_set(c): + z = 0 + for i in range(40): + z = z*z + c + if abs(z) > 60: + return False + return True + +for v in range(31): + line = [] + for u in range(91): + line.append('*' if in_set((u / 30 - 2) + (v / 15 - 1) * 1j) else ' ') + print(''.join(line)) |