导语

小编在昨天看了一个非常好玩的充电器,就是魔法阵充电器。这种感觉,完全是满满的中二气

息啊。魔法阵开启!哈哈哈(感觉有点儿幼稚,但是还挺有趣的)

魔法阵一直都出现在小说、动漫、电影、电视剧中,是能够施展强大咒力的神圣空间,也是能

承受更多魔法的阵法。阵法不同作用不同,我们看过的常见的一般都是释放魔法、召唤某些圣

兽、魔物、时空转移等等,看起来都非常酷炫。其中,有一部动漫记忆深刻《魔法小樱》,嘻

嘻,有多少人是和我一样,看着《魔法小樱》长大的呢?(感觉暴露了年龄)

那今天小编就带大家来看看各种不一样的《百变魔法阵》这是一个合集(多份源码)啦!

正文

”隐藏着星星力量的钥匙啊,在我面前显示你真正的力量。曾与你定下约定的小樱命令你,解除

封印!“噗~少女心+中二气息扑面而来。

一、零级魔法阵

1)效果展示

2)代码展示

import turtle as tr
import numpy as np
import math__radiusBig = 360  # 大圆
__radiusSmall = 340  # 小圆def circle():"""绘制外圈的两个圆,半径分别为__radiusBig,__radiusSmall"""# 修改画笔粗细tr.pensize(2)# 画大圆tr.penup()tr.right(90)tr.forward(__radiusBig)tr.left(90)tr.pendown()  # 将圆形放置于画布中心tr.circle(__radiusBig)# 画小圆tr.penup()tr.right(90)tr.backward(__radiusBig - __radiusSmall)tr.left(90)tr.pendown()  # 将圆形放置于画布中心tr.circle(__radiusSmall)def repeat(repeatNum):"""绘制重复部分"""# 修改画笔粗细tr.penup()tr.right(90)tr.backward(__radiusSmall * 2)tr.right(90)tr.pendown()radius = __radiusSmallfor num in range(repeatNum):tr.pensize(2 / (num + 1))# 计算五角星边长(np.square:取平方,math.radians:度转弧度)pentagramLen = np.sqrt(np.square(radius) * 2 - np.square(radius) * 2 * math.cos(math.radians(144)))# 计算缩小值shrink = np.sqrt(np.square(radius) + np.square(radius * math.sin(math.radians(144))) -2 * radius * radius * math.sin(math.radians(144)) * math.cos(math.radians(54)))# 从顶部开始绘制五边形tr.circle(radius, steps=5)  # 半径为radius圆的内切正steps边形# 绘制五角星tr.penup()tr.right(108)tr.pendown()for i in range(5):tr.right(144)tr.forward(pentagramLen)# 画圆tr.penup()tr.left(18)tr.backward(radius - shrink)tr.left(90)tr.pendown()  # 将圆形放置于画布中心tr.circle(shrink, extent=396)  # 绘制半径为shrink,角度为396的圆radius = shrinkdef main():"""主函数"""tr.screensize(bg="#262626")  # 设置背景颜色tr.pencolor('#F8F8FF')  # 修改画笔颜色tr.speed(10)  # 加快绘制速度tr.hideturtle()  # 隐藏画笔形状# 画圆circle()# 画圆里面的部分repeat(15)tr.exitonclick()  # 点击画布退出if __name__ == '__main__':"""程序入口"""main()

3)壁纸合集(1)

二、初级魔法阵

1)效果展示

2)代码展示

import turtle as t
import matht.screensize(400, 300, 'black')
t.tracer(False)
t.color("yellow")def a(d=0):t.up()t.speed(10)t.goto(0, -200)t.down()t.circle(200)t.up()t.home()t.goto(0, -300)t.down()t.circle(300)t.up()t.home()t.right(90)t.left(90)n = 0while n < 12:#print(30*n+d)t.right(30*n+d)t.forward(200)t.down()t.forward(100)t.up()t.home()n += 1t.home()t.left(90)t.left(d)t.forward(200)#六边形t.down()t.left(180)t.left(30) #-------------t.forward(345)t.right(30)t.right(90)t.forward(345)t.right(90)t.right(30) #-------------t.forward(345)t.up()t.home()t.right(90) #-------------t.forward(200)t.home()t.left(90)t.left(d)t.left(180)t.forward(200)t.right(180)t.down()t.left(30) #-------------t.forward(345)t.right(30)t.right(90) #-------------t.forward(345)t.right(90)t.right(30) #-------------t.forward(345)t.up()t.home()t.left(90)t.left(d)t.left(90)t.forward(200)t.right(180)t.down()t.left(30)t.forward(345)t.right(30)t.right(90)t.forward(345)t.right(30)t.right(90)t.forward(345)t.up()t.home()t.left(90)t.left(d)t.left(180+90)t.forward(200)t.right(180)t.down()t.left(30)t.forward(345)t.right(30)t.right(90)t.forward(345)t.right(30)t.right(90)t.forward(345)t.up()t.home()t.backward(30)t.down()t.write("*  *", font=("Microsoft JhengHei", 24))t.up()def g():n = 0while 1:if n == 361:n = 0a(n)n+= 1t.clear()g()

3)壁纸合集(2)

三、一级魔法阵

1)效果展示

2)代码展示

import turtle as p
import os
import time as tp.setup(800,800,0,0)
p.bgcolor(0,0,0)
p.color((0,1,1),(1,1,1))
i=0
p.speed(1)p.penup()
p.goto(15,0)
p.left(90)
p.pendown()
p.circle(15)t.sleep(1)while i<12 :p.circle(15,30)p.right(90)p.fd(5)p.bk(5)p.left(90)i+=1i=0t.sleep(1)p.goto(20,0)
p.circle(20)t.sleep(1)p.penup()p.goto(200,0)
p.pendown()
p.circle(200)
p.goto(195,0)t.sleep(1)while i<12 :p.circle(195,30)p.right(90)p.fd(5)p.bk(5)p.left(90)i+=1i=0t.sleep(1)p.penup()
p.goto(0,195)
p.pendown()
p.left(90)while i<12 :p.left(60)p.fd(337.7)p.bk(337.7)p.right(60)p.circle(195,30)i+=1
i=0p.penup()
p.goto(0,195/2)t.sleep(1)p.pendown()p.circle(195/2)p.penup()p.goto(-160,300)
p.pendown()
p.write('* *',font=('NLXJT',15,'normal'))
p.penup()p.color((0,0,0),(0,0,0))

3)壁纸合集(3)

​四、二级魔法阵

1)效果展示

2)代码展示

import turtle as t
def tcyuan(x,y,r):t.fillcolor("black")t.begin_fill()t.seth(0)y = y - rt.penup()t.goto(x, y)t.pendown()t.circle(r)t.end_fill()
def yuan(x,y,r):t.seth(0)y=y-rt.penup()t.goto(x,y)t.pendown()t.circle(r)
def yueliang():R = 110 -1r = R - 22 -1# 月亮填充t.penup()t.goto(-350+2*R,0)t.seth(90)t.fillcolor("black")t.begin_fill()t.circle(R,359)t.left(90)t.fd(2)t.left(90)t.circle(-r,359)t.left(90)t.fd(2)t.pendown()t.end_fill()#轮廓yuan(-350 + R, 0, R)yuan(-350 + 44 + r - 2, 0, r - 2)
def zhixian(R,r,count,jiaodu):t.seth(90+jiaodu)
#    t.goto(0, 0)for i in range(count):t.penup()t.goto(0, 0)t.fd(r)t.pendown()t.fd(R-r)t.left(360/count)
def zfx(R,r):jiange = 10
#    t.pensize(jiange)t.seth(90)big = pow((R**2)*2,0.5)small = big-2*jiangefor i in range(13):#大线t.penup()t.goto(0,0)t.fd(R)t.pendown()t.right(135)t.fd(big)#小线t.left(135)t.penup()t.goto(0, 0)t.fd(pow((small**2)/2,0.5))t.pendown()t.right(135)t.fd(small)#粗线t.pensize(8)t.pencolor("black")t.left(135)t.penup()t.goto(0, 0)t.fd((R+pow((small ** 2) / 2, 0.5))/2)t.pendown()t.right(135)t.fd((big+small)/2)t.pensize(2)t.pencolor("yellow")t.seth(90+i*30)else:# 大线t.penup()t.goto(0, 0)t.fd(R)t.right(135)t.fd(big / 2)t.pendown()t.fd(big / 2)# 小线t.left(135)t.penup()t.goto(0, 0)t.fd(pow((small ** 2) / 2, 0.5))t.right(135)t.fd(small/2)t.pendown()t.fd(small/2)# 粗线t.pensize(8)t.pencolor("black")t.left(135)t.penup()t.goto(0, 0)t.fd((R + pow((small ** 2) / 2, 0.5)) / 2)t.right(135)t.fd((big + small) / 2/2)t.pendown()t.fd((big + small) / 2/2)t.pensize(2)t.pencolor("yellow")t.seth(90 + i * 30)
def wjx(r,jiaodu):t.fillcolor("black")t.penup()t.goto(0,0)t.seth(90+jiaodu)t.fd(r)t.pendown()t.right(18)t.begin_fill()for i in range(5):t.right(144)t.forward(144)t.left(72)t.forward(144)t.end_fill()if jiaodu!=0:t.seth(90 + jiaodu)for i in range(1,6):t.penup()t.goto(0, 0)t.left(72)t.pendown()t.fd(r)
def xingzuo():r = 250t.penup()t.goto(20,-35)t.seth(-45)t.fd(r)t.pendown()xz=['♒','♓','♈','♉','♌','♍','♎','♏']for i in range(4):t.write(xz[i],font=("", 20, ""))t.penup()t.right(90)t.circle(-300, 30)t.left(90)t.pendown()t.penup()t.goto(-r/4+10, 5)t.seth(135)t.fd(r)for i in range(4,8):t.write(xz[i],font=("", 20, ""))t.penup()t.right(90)t.circle(-300, 30)t.left(90)t.pendown()
def dxnb(s):t.penup()t.fd(-19)t.left(90)t.fd(2)t.pendown()t.write(s, font=["KaiTi", 30, "bold"])
def taiyang():def haicao(r,i):# 海藻t.fillcolor("black")t.penup()if i==0:t.goto(256, r)elif i==1:t.goto(256-r, 0)else:t.goto(256, -r)t.pendown()t.begin_fill()t.seth(2+i*90)t.circle(r / 2, 105)t.left(10)t.circle(-r / 3, 90)t.circle(r / 3, 60)t.left(20)t.circle(r / 3, -80)t.left(50)t.circle(-r + 10, -40)t.right(30)t.circle(r / 2 + 10, -50)t.penup()if i == 0:t.goto(256, r)elif i == 1:t.goto(256 - r, 0)else:t.goto(256, -r)t.pendown()t.end_fill()t.seth(2 + i * 90)t.circle(r / 2, 105)t.left(10)t.circle(-r / 3, 90)t.begin_fill()t.circle(r / 3, 60)t.left(20)t.circle(r / 3, -80)t.left(50)t.circle(-r + 10, -40)t.right(30)t.circle(r / 2 + 10, -50)t.right(30)t.circle(r / 2 - 2, 110)t.circle(-r / 3, 70)t.left(7)t.circle(r / 3, 85)t.end_fill()t.penup()if i == 0:t.goto(256, r)t.pendown()t.seth(180 - (2 + i * 90))t.circle(-(r / 2), 105)elif i == 1:t.goto(256 - r, 0)t.pendown()t.seth(- (2 + i * 90))t.circle(-(r / 2), 105)else:t.goto(256, -r)t.pendown()t.seth(180 - (2 + i * 90))t.circle(-(r / 2), 105)t.begin_fill()t.left(-10)t.circle(-(-r / 3), 90)t.circle(-(r / 3), 60)t.left(-20)t.circle(-(r / 3), -80)t.left(-50)t.circle(-(-r + 10), -40)t.right(-30)t.circle(-(r / 2 + 10), -50)t.end_fill()t.penup()if i == 0:t.goto(256, r)t.pendown()t.seth(180 - (2 + i * 90))t.circle(-(r / 2), 105)elif i == 1:t.goto(256 - r, 0)t.pendown()t.seth(- (2 + i * 90))t.circle(-(r / 2), 105)else:t.goto(256, -r)t.pendown()t.seth(180 - (2 + i * 90))t.circle(-(r / 2), 105)t.pendown()t.left(-10)t.circle(-(-r / 3), 90)t.circle(-(r / 3), 60)t.left(-20)t.begin_fill()t.circle(-(r / 3), -80)t.left(-50)t.circle(-(-r + 10), -40)t.right(-30)t.circle(-(r / 2 + 10), -50)t.right(-30)t.circle(-(r / 2 - 2), 110)t.circle(-(-r / 3), 70)t.left(-7)t.circle(-(r / 3), 85)t.end_fill()def xhaicao(r,i):t.penup()t.goto(256 + r, 0)t.seth(-90)t.circle(-r,20)t.pendown()t.begin_fill()t.seth(30)t.circle(-r/3,100)t.circle(r/6,140)t.circle(-r/11,100)t.left(80)t.circle(-r/2,-30)t.circle(r/4,-140)t.circle(-r/3,-60)t.end_fill()t.penup()t.goto(256 + r, 0)t.seth(-90)t.circle(-r, 30)t.pendown()t.seth(45)t.circle(-r / 4, 100)t.right(20)t.circle(r / 4, 140)t.right(10)t.circle(-r / 11, 90)t.penup()t.goto(256 + r, 0)t.seth(90)t.circle(r, 20)t.pendown()t.begin_fill()t.seth(-30)t.circle(-(-r / 3), 100)t.circle(-(r / 6), 140)t.circle(-(-r / 11), 100)t.left(-80)t.circle(-(-r / 2), -30)t.circle(-(r / 4), -140)t.circle(-(-r / 3), -60)t.end_fill()t.penup()t.goto(256 + r, 0)t.seth(90)t.circle(r, 30)t.pendown()t.seth(-45)t.circle(-(-r / 4), 100)t.right(-25)t.circle(-(r / 4), 140)t.right(-10)t.circle(-(-r / 11), 90)r = 50# 海藻haicao(r, 0)haicao(r, 1)haicao(r, 2)xhaicao(r,3)#大三角形t.fillcolor("black")for i in range(1,4):temp = 3t.penup()t.goto(256, 0)t.seth(i * 90)t.pendown()t.begin_fill()t.right(22.5)t.fd(r)if i==1:t.goto(256,3*r-temp)t.goto(256,0)t.seth(i*90+22.5)t.fd(r)t.goto(256,3*r-temp)elif i==2:t.goto(256- 3 * r+temp,0)t.goto(256, 0)t.seth(i * 90 + 22.5)t.fd(r)t.goto(256-3 * r+temp,0)else:t.goto(256, -3 * r+temp)t.goto(256, 0)t.seth(i * 90 + 22.5)t.fd(r)t.goto(256, -3 * r+temp)t.end_fill()# 小三角形x = pow(((2 * r) ** 2) / 2, 0.5)-8for i in range(1,5):t.penup()t.goto(256, 0)t.seth(i * 90)t.pendown()t.begin_fill()t.right(22.5)t.fd(r)if i==1:t.goto(256+x,x)t.goto(256,0)t.right(45)t.fd(r)t.goto(256+x,x)elif i==2:t.goto(256 - x, x)t.goto(256, 0)t.right(45)t.fd(r)t.goto(256 - x, x)elif i==3:t.goto(256 - x, -x)t.goto(256, 0)t.right(45)t.fd(r)t.goto(256 - x, -x)else:t.goto(256 + x, -x)t.goto(256, 0)t.right(45)t.fd(r)t.goto(256 + x, -x)t.end_fill()#圆
#    t.begin_fill()tcyuan(256,0,r)
#初始化
t.setup(1500,800,0,0)
t.speed(0)
t.bgcolor("black")
t.pencolor("yellow")
t.pensize(2)
#最大的圆
yuan(0,0,350)
yuan(0,0,325)
yuan(0,0,321)
yuan(0,0,306)
zhixian(321,306,72,0)
#小圆
yuan(0,0,204)
yuan(0,0,200)
yuan(0,0,186)
zhixian(200,186,72,0)
#正方形边框以及直线
zhixian(290,213,12,0)
zhixian(248,205,12,15)
zfx(306,204)
#里五角星
wjx(200,36)
#月亮
yueliang()
#太阳
taiyang()
#最小圆
tcyuan(0,328,22)
dxn("北")
tcyuan(0,-328,22)
dxnb("南")
tcyuan(-328,0,22)
dxnb("西")
tcyuan(328,0,22)
dxnb("東")#外五角星
wjx(200,0)
#星座
xingzuo()
t.penup()
t.goto(-500,-500)
t.pendown()
t.done()

3)壁纸合集(4)

五、终极魔法阵

这里仅展示效果撒,代码超多滴,需要的文末找我拿哈

【Turtle合集】火遍抖音的五款魔法阵终于被我找到了(初代萌王,童年的小樱回来了)相关推荐

  1. 火遍抖音的3D旋转特效

    火遍抖音的3D旋转特效代码前端代码实现: 3d旋转特效.html 0000644 0000764 0000765 00000015444 13577153703 014745 0 ustar www ...

  2. 火遍抖音的八卦时钟matlab源代码来了

    在浏览抖音的时候看见一款名叫"八卦时钟"的视频,看起来很炫酷,于是小编决定亲自动手采用matlab来实现. 实现原理并不难,要求相应的年.月.日.星期.时.分和秒能跟随本地时间实时 ...

  3. 超火的抖音表情包制作教程

    喜欢玩抖音的小伙伴都知道抖音聊天里有很多超火的GIF表情包,比如跳舞.蹦迪.疯狂甩头.穿衣服.要红包.撩人.抱胸生气等多种表情包在抖音聊天记录里面简直是层出不穷.大家知道抖音里这些超火的GIF表情包是 ...

  4. 抖音等多款软件涉代码抄袭,字节跳动被诉赔22.74亿元;iPhone12系统更新后性能退回3年前;Qt 6.1正式发布|极客头条...

    「极客头条」-- 技术人员的新闻圈! CSDN 的读者朋友们早上好哇,「极客头条」来啦,快来看今天都有哪些值得我们技术人关注的重要新闻吧. 整理 | 梦依丹 出品 | CSDN(ID:CSDNnews ...

  5. 抖音等多款软件涉代码抄袭,字节跳动被诉赔 22.74 亿元

    4 月 30 日,美摄科技通过微信公众号发布声明表示,自 2018 年 11 月 1 日"抖音" 3.0 版本至今,其实现音频编辑处理等功能的相关软件代码,大量抄袭自美摄科技享有著 ...

  6. 抖音为什么这么火?抖音用户暴涨的秘密在哪?

    当前各大APP下载量最火的莫过于抖音了,从瞬时的崛起到长期的称霸排行榜,抖音崛起之路让人羡慕,但这并非是偶然的,完全是抓住了用户的使用习惯.抖音用户暴涨同样给众多APP运营者带来了思考: 你如何衡量用 ...

  7. 辽宁聚能合创科技:抖音店铺怎么刺激消费?

    在抖音平台分享好物也是能赚钱的,但是也有人想要了解分享好物是否真的有提成,那么具体应该怎么做呢?跟着辽宁聚能合创小编来一起看看吧! 1.抖音最初是年轻人的天堂,现在正受到越来越多各个年龄段的人的追捧. ...

  8. 商家如何抓住当下最火的抖音本地生活?

    本地生活这个巨大的市场,吸引了不少巨头杀入赛道,抖音也不例外.今年上半年,抖音本地生活的GMV约为220亿元,已经超过去年的全年数据.当短视频.直播与本地生活服务深入结合,商家如何抓住机遇? 后疫情时 ...

  9. 容易火的抖音内容和模仿同行要点

    啥叫高关注度内容,就是大家都愿意关注的内容,不分性别,年龄,种族,全部都爱看的,主要也分为三类:. a.赏心悦目. 主要是颜值比较高的,比如长的帅的,长的美的. 抖音联盟内部教程 另外一个是风景秀丽, ...

最新文章

  1. 推荐好用 Spring Boot 内置工具类
  2. 如何设计网站导航更利于SEO优化?
  3. Java 基础数据类型
  4. 158.5. manifests
  5. 【OpenCV】OpenCV实战从入门到精通之 -- 离散傅里叶变换相关函数详解
  6. python质量转换程序,Python库的文件转换成MP3和设置它们的质量
  7. Python GStreamer Tutorial
  8. AD6.8_mcu123 分享地址
  9. 2021-eclipse的安装及环境配置
  10. 黑客帝国之八种超级武器
  11. mtk平台dump系统分区
  12. 【演示文稿制作软件】Focusky教程 | 利用动画角色让演示文稿更生动
  13. 忘了她,就像忘了一朵花
  14. Mongodb常用查询
  15. 微信公众号之在图片上添加热点链接
  16. 第39级台阶回溯算法c语言,五大经典算法之回溯法 - osc_9ipdey7e的个人空间 - OSCHINA - 中文开源技术交流社区...
  17. 4天快速落地团队内部的UI组件库
  18. 整数转罗马数字(C++)
  19. P15~P19 分支和循环
  20. 于神之怒加强版 [Bzoj 4407]

热门文章

  1. Java 岗位 100道 面试题及答案详解
  2. 校招在线测评题目汇总
  3. python面向对象类创建人物类包含姓名、职业_Python面向对象思想与应用入门教程【类与对象】...
  4. 协议(四)-通信发展史
  5. Mob研究院|长租公寓洞察:蛋壳破了,自如安否?
  6. Android:简单打电话 APP
  7. Android 中替换开机动画(附动画包)
  8. 如何修复“网络路径”,错误代码0x80070035
  9. 【程序员变帅指南】相亲不穿特步,提升衣品变酷
  10. Ubuntu下Android开发环境搭建