mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-28 22:17:12 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
#! /usr/bin/env micropython
|
||||
|
||||
from micropython import mem_info
|
||||
|
||||
POINTS = list(",.:-;!/>)|&IH%*Z")
|
||||
|
||||
|
||||
def mandel():
|
||||
for y in range(-15, 16):
|
||||
for x in range(1, 85):
|
||||
i = 0
|
||||
r = 0
|
||||
for k in range(112):
|
||||
j = (r*r) - (i*i) - 2 + (x/25)
|
||||
i = 2 * r * i + (y/10)
|
||||
if j*j + i*i >= 11:
|
||||
break
|
||||
r = j
|
||||
print(POINTS[k & 0xF], end='')
|
||||
print()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mandel()
|
||||
mem_info()
|
||||
@@ -0,0 +1,15 @@
|
||||
#! /usr/bin/env micropython
|
||||
|
||||
import gzip
|
||||
import sys
|
||||
|
||||
|
||||
def main(fname):
|
||||
with open(fname, "rb") as f:
|
||||
with gzip.GzipFile(fileobj=f) as g:
|
||||
s = g.read()
|
||||
print(s.decode("UTF-8"), end="")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1])
|
||||
Reference in New Issue
Block a user