File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ .DS_Store
1
2
# Byte-compiled / optimized / DLL files
2
3
__pycache__ /
3
4
* .py [cod ]
Original file line number Diff line number Diff line change
1
+ #-*- coding: utf-8 -*-
2
+ ####################################
3
+ ### 99 rose curves for QXT ###
4
+ ### Happy Valentine's Day~ ###
5
+ ### by Crossin ###
6
+ ####################################
7
+ #
8
+ # 欢迎关注
9
+ # 微信公众号:Crossin的编程教室
10
+ # 微信号:crossincode
11
+ # 论坛:bbs.crossincode.com
12
+ #
13
+
14
+ import math
15
+ rad = 12
16
+ heart = u'\u2665 ' .encode ('utf8' )
17
+ curve = []
18
+ for i in range (rad * 2 + 1 ):
19
+ curve .append ([])
20
+ for j in range (rad * 2 + 1 ):
21
+ curve [i ].append (' ' )
22
+ for n in range (1 ,100 ):
23
+ print n
24
+ for k in range (360 ):
25
+ angle = k * math .pi / 180
26
+ x = int (rad * math .sin (n * angle ) * math .sin (angle )) + rad
27
+ y = int (rad * math .sin (n * angle ) * math .cos (angle )) + rad
28
+ curve [x ][y ] = heart
29
+ for i in range (rad * 2 + 1 ):
30
+ for j in range (rad * 2 + 1 ):
31
+ print curve [i ][j ],
32
+ curve [i ][j ] = ' '
33
+ print
You can’t perform that action at this time.
0 commit comments