首页 > 其他分享 >Experience Six

Experience Six

时间:2023-06-08 18:23:14浏览次数:33  
标签:__ Six Experience range import circle main def

Task1:basic graph

task1_1.py

from turtle import *

def move(x,y):
    penup()
    goto(x,y)
    pendown()

def draw(n,size=100):
    for i in range(n):
        fd(size)
        left(360/n)

def main():
    pensize(2)
    pencolor('red')

    move(-200,0)
    draw(3)

    move(0,0)
    draw(4)

    move(200,0)
    draw(5)

    hideturtle()
    done()

if __name__=="__main__":
    setup(700,700)
    main()

 task1_2.py

from turtle import *
def moveto(x,y):
    penup()
    goto(x,y)
    pendown()

def main():
    pensize(2)
    pencolor('blue')

    moveto(-150,0)
    circle(50)

    moveto(0,0)
    circle(50,steps=4)

    moveto(150,0)
    circle(50,steps=5)

    moveto(300,0)
    circle(50,steps=6)

    hideturtle()
    done()

if __name__=="__main__":
    setup(1000,300)
    main()

 Task2:Concentric Circle

task2_1.py

from turtle import *
def moveto(x,y):
    penup()
    goto(x,y)
    pendown()

def main():
    setup(800,600)

    radius=20
    offset=20#半径等差

    for i in range(9):
        moveto(0,-radius)
        circle(radius)
        radius+=offset

    hideturtle()
    done()

if __name__=="__main__":
    main()

 task2_2.py

from turtle import *
from random import random

def moveto(x,y):
    penup()
    goto(x,y)
    pendown()

def gen_color():
    return tuple(random() for i in range(3))

def main():
    setup(800,600)

    radius=180
    offset=20

    for i in range(8):
        moveto(0,-radius)
        color(gen_color())

        begin_fill()
        circle(radius)
        end_fill()

        radius-=offset

    hideturtle()
    done()

if __name__=="__main__":
    main()

task2_2plus.py

from turtle import *
import task2_2

def square(size=50,rgb='pink'):
    pencolor(rgb)
    for i in range(4):
        fd(size)
        left(90)

def main():

    setup(800,600)
    speed(0)

    n=20
    for i in range(n):
        begin_fill()
        color(task2_2.gen_color(),task2_2.gen_color())
        circle(80)
        end_fill()
        left(360/n)

    hideturtle()
    done()

if __name__=='__main__':
    main()

 

 

 

Task3:Petal

task3_1.py

from turtle import *

def square(size=50,rgb='pink'):
    pencolor(rgb)
    for i in range(4):
        fd(size)
        left(90)

def main():

    setup(800,600)
    speed(0)

    n=20
    for i in range(n):
        circle(80)#
        left(360/n)

    hideturtle()
    done()

if __name__=='__main__':
    main()

 task3_2.py

from turtle import *
setup(800, 600)
pencolor('pink')
pensize(10)
n = 6
for i in range(6):
    for j in range(2):
        circle(90, 60)
        left(120)
    right(360/n)
hideturtle()
done()

 task3_2plus.py

from turtle import *
setup(800, 600)
pencolor('pink')
pensize(4)
n = 11
for i in range(11):
    for j in range(2):
        circle(80, 90)
        left(90)
    right(360/n)
hideturtle()
done()

 

标签:__,Six,Experience,range,import,circle,main,def
From: https://www.cnblogs.com/M-H-Bi/p/17466678.html

相关文章

  • 初识云平台-3DEXPERIENCE在线课程 硕迪科技
     3DEXPERIENCE平台可以理解为人与人协作、数据与数据关联、人与数据互动的企业运营支撑平台。本期课程为大家介绍第一次进入3DEXPERIENCE所需要做的一些基础准备工作。内容分为两大部分,一部分是作为平台管理员在平台所需做的基础设置;另一部则是作为平台基本用户可以做的自定义设......
  • posix
    转载:posix是什么都不知道,还好意思说你懂Linux?(qq.com)Linux开发者越来越多,但是仍然有很多人整不明白POSIX是什么。本文就带着大家来了解一下到底什么是POSIX,了解他的历史和重要性。一、什么是posix?1.概念POSIX:可移植操作系统接口(PortableOperatingSystemInterfaceofUNI......
  • Revisiting Prioritized Experience Replay: A Value Perspective
    发表时间:2021文章要点:这篇文章想说Prioritizedexperiencereplay这类方法通过surprise(themagnitudeofthetemporal-differenceerror)来采样,但是surprise只能量化unexpectedness,experience的重要性还是不清楚(importance)。作者定义experience的重要度在于可以给更新带来......
  • Apr 2021-Lucid Dreaming for Experience Replay: Refreshing Past States with the
    摘要:经验回放(ER)通过允许智能体在回放缓冲区中存储和重用其过去的经验,提高了离线强化学习(RL)算法的数据效率。虽然已经提出了许多技术,以通过偏差如何从缓冲区中采样来增强ER,但迄今为止,它们还没有考虑在缓冲区内刷新经验的策略。本文提出了用于经验回放的清醒梦(LiDER),一个概念上......
  • CentOS 7.x安装微服务网关Apache APISIX
    阅读文本大概需要3分钟。    APISIX是一个云原生、高性能、可扩展的微服务API网关。它是基于OpenResty和etcd来实现,和传统API网关相比,APISIX具备动态路由和插件热加载,特别适合微服务体系下的API管理。APISIX通过插件机制,提供动态负载平衡、身份验证、限流限速等功能,并且......
  • POSIX 进程间通信 (可移植操作系统接口)
    1、什么是POSIX标准PortableOperatingSystemInterfaceforComputingSystem.他是一个针对操作系统(准确地说是针对类Unix操作系统)的标准化协议。这个协议是对操作系统服务接口的标准化,从而保证了应用程序在源码层次的可移植性。如今主流的Linux系统都做到了兼容POSIX标准。......
  • 用POSIX线程库创建带优先级的线程
    #include<iostream>#include<pthread.h>void*threadFunction(void*arg){//线程函数逻辑//...returnnullptr;}intmain(){pthread_tthread;pthread_attr_tattr;//初始化线程属性pthread_attr_init(&attr);//......
  • Visual Components Experience功能介绍 衡祖仿真
    借助VisualComponentsExperience,可以在移动设备和虚拟现实中体验您使用VisualComponents设计的3D模拟。虚拟现实●完全身临其境且引人入胜的体验入了一种处理生产设计和规划的新方法●让观众在完全身临其境的虚拟环境中体验您的布局●我们的虚拟现实应用程序为制造商和......
  • apisix 容器安装
    1.按照官方文档进行docker容器安装,安装完成后启动报错,关键错误日志如下:apisix|2023/05/2506:36:35[error]7#7:*205[lua]resolver.lua:80:parse_domain():failedtoparsedomain:etcd-server,error:failedtoquerytheDNSserver:dnsservererror:3nameerro......
  • May 2022-Neighborhood Mixup Experience Replay: Local Convex Interpolation for Im
    摘要:经验回放在提高深度强化学习智能体的样本效率方面起着至关重要的作用。经验回放的最新进展建议使用Mixup-2018,通过合成样本生成进一步提高样本效率。在这种技术的基础上,提出了邻域混合经验回放(NMER),一种基于几何的回放缓冲区,用状态-动作空间中最近邻的转换进行插值。NMER仅......