par , 29/12/2020 à 06h14 (1245 Affichages)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| # -*- coding:utf-8 -*-
#
# Illuminations virtuelles Fin d'Année
#
from turtle import *
from math import cos
from math import pi
from random import randrange
flag=True
c=["red","blue","violet","yellow","purple","green","cyan","magenta"]
while flag:
x=-360
y=0.0
while x<=360:
xx=2*pi*x/360
y=(cos(xx)*50)+200
xc=int(randrange(8))
color(c[xc])
up()
goto(x,y)
down()
dot(20)
x=x+40
x=360
y=0.0
while x>=-360:
xx=2*pi*x/360
y=(-cos(xx)*50)-200
xc=int(randrange(8))
color(c[xc])
up()
goto(x,y)
down()
dot(20)
x=x-40
phrase1="H A P P Y"
phrase2=" 2 0 2 1 "
xc=int(randrange(8))
color(c[xc])
up()
goto(-10,10)
down()
write(phrase1)
up()
xc=int(randrange(8))
color(c[xc])
goto(-10,-10)
down()
write(phrase2)
up() |
happy_2021.py