1 Star 0 Fork 110

积微 / snippet

forked from crossin / snippet 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ValentinesDay.py 890 Bytes
一键复制 编辑 原始数据 按行查看 历史
crossin 提交于 2016-06-01 22:01 . rose
#-*- coding: utf-8 -*-
####################################
### 99 rose curves for QXT ###
### Happy Valentine's Day~ ###
### by Crossin ###
####################################
#
# 欢迎关注
# 微信公众号:Crossin的编程教室
# 微信号:crossincode
# 论坛:bbs.crossincode.com
#
import math
rad = 12
heart = u'\u2665'.encode('utf8')
curve = []
for i in range(rad*2+1):
curve.append([])
for j in range(rad*2+1):
curve[i].append(' ')
for n in range(1,100):
print n
for k in range(360):
angle = k * math.pi / 180
x = int(rad * math.sin(n * angle) * math.sin(angle)) + rad
y = int(rad * math.sin(n * angle) * math.cos(angle)) + rad
curve[x][y] = heart
for i in range(rad*2+1):
for j in range(rad*2+1):
print curve[i][j],
curve[i][j] = ' '
print
Python
1
https://gitee.com/jiwei7/snippet.git
git@gitee.com:jiwei7/snippet.git
jiwei7
snippet
snippet
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891