File tree Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Original file line number Diff line number Diff line change 1
- import datetime
2
-
3
- start = datetime .datetime .now ()
1
+ import time
4
2
5
3
pixels = " .:~÷+<*/([{@%&$"
6
- for py in range (0 ,22 ):
7
- for px in range (0 ,32 ):
8
- xz = px * 3.5 / 32 - 2.5
9
- yz = py * 2 / 22 - 1
10
- x = 0
11
- y = 0
12
- for i in range (0 ,15 ):
13
- if x * x + y * y > 4 :
14
- break
15
- xt = x * x - y * y + xz
16
- y = 2 * x * y + yz
17
- x = xt
18
- print (pixels [i - 1 ],end = "" )
19
- print ("" )
20
-
21
- delta = datetime .datetime .now () - start
22
- print ("Time = " + str (delta .total_seconds ()) + " seconds" )
4
+
5
+ def mand ():
6
+ start = time .time_ns ()
7
+ for py in range (0 ,22 ):
8
+ for px in range (0 ,32 ):
9
+ xz = px * 3.5 / 32 - 2.5
10
+ yz = py * 2 / 22 - 1
11
+ x = 0
12
+ y = 0
13
+ for i in range (0 ,15 ):
14
+ if x * x + y * y > 4 :
15
+ break
16
+ xt = x * x - y * y + xz
17
+ y = 2 * x * y + yz
18
+ x = xt
19
+ print (pixels [i - 1 ],end = "" )
20
+ print ("" )
21
+ delta = time .time_ns () - start
22
+ print ("Time = " + str (delta / 1000000000 ) + " seconds" )
23
+
24
+ mand ()
25
+
You can’t perform that action at this time.
0 commit comments