![](https://i.imgur.com/sPPZ6Nxt.png)
Il te suffisait de programmer et envoyer un superbe dessin de Noël sur ta calculatrice Casio ou son émulateur, avec 2 catégories au choix :
- fx-92+ Spéciale Collège (langage de programmation orienté tracé à la Scratch/Logo)
- Casio Graph 35+E II ou Graph 90+E avec l'application Python
![](https://i.imgur.com/aSC4ffqt.jpg?2)
- pour le meilleur dessin, un superbe lot de 180€ de valeur médiane : 1 disque dur externe SSD de 1 To de capacité + 1 calculatrice graphique Casio Graph 90+E ou Graph 35+E II au choix
- pour le 2ème meilleur dessin, un non moins superbe lot de 150€ de valeur médiane : 1 enceinte bluetooth + 1 calculatrice graphique Casio Graph 90+E ou Graph 35+E II au choix
- pour tous les autres pas de perdant avec un superbe lot de participation : 1 batterie externe + 1 clé USB
Les gagnants ont maintenant été choisis par Casio, et l'ensemble des participants prévenus de leur lot par courriel.
Plusieurs participants ont partagé leurs scripts Python et nous allons te les présenter ci-dessous, ainsi que de façon tout à fait officieuse les résultats du concours puisque par pur hasard les meilleurs dessins choisis par Casio en font partie !
![Bien joué! :bj:](./images/smilies/sg3agbjg3ag.gif)
![;) ;)](./images/smilies/wink.png)
Je ne souhaitais piquer de lot à personne et je l'ai bien dit, et c'est parfait puisque je gagne bien le seul lot de participation.
![:) :)](./images/smilies/smile.png)
Ce script dispose d'un mode monochrome, et est compatible à la fois Graph 35+E II et Graph 90+E, même si c'est sur cette dernière qu'il révèle son plein potentiel.
Voici l'astuce utilisée pour détecter le type d'écran :
- Code: Select all
def init_casioplot():
global color_screen, screen_w, screen_h
set_pixel(0, 0, (0, 0, 255))
col = get_pixel(0, 0)
color_screen = col[0] != col[2]
screen_w, screen_h = color_screen and (384, 192) or (128, 64)
Dans l'ordre, mon script utilisant la bibliothèque de tracé par pixels casioplot :
- fait tomber la nuit : Il utilise ici 2 dégradés dans les tons de bleu pour représenter le sol et le ciel.
- allume les étoiles (pixels blancs)
- plante une forêt de sapins - nous allons y revenir
- décore mon plus beau sapin : des disques de rayon 2 selon 3 couleurs de remplissage alternées, avec une couleur voisine pour la bordure rajoutant un peu de relief
- saupoudre le tout de neige : des disques de rayon 1
La bibliothèque casioplot offre un nombre assez restreint de fonctions de tracé :
- clear_screen() pour effacer l'écran en blanc
- set_pixel(x,y,couleur) pour allumer un pixel dans une couleur (R,G,B) au choix
- draw_string(x,y,string,couleur,taille) pour écrire du texte dans une couleur RGB et selon une taille de police au choix ("small", "medium" ou "large")
Ce n'est absolument pas un défaut, au contraire cela permet un travail absolument passionnant : la construction et optimisation de fonctions pour tracer chaque primitive. J'ai donc rajouté de quoi tracer des cercles, disques, mais également segments pour les sapins :
- Code: Select all
def draw_line(x1, y1, x2, y2, c):
m, a1, b1, a2, b2 = 0, int(x1), int(y1), int(x2), int(y2)
if (x2 - x1) ** 2 < (y2 - y1) ** 2:
m, a1, a2, b1, b2 = 1, b1, b2, a1, a2
if min(a1, a2) != a1: a1, b1, a2, b2 = a2, b2, a1, b1
for k in range(a2 - a1 + 1):
a, b = a1 + k, int(b1 + (b2 - b1) * k / ((a2 - a1) or 1))
set_pixel((a, b)[m], (b, a)[m], c)
def draw_ellipse(x, y, rx, ry, c):
for h in range(-int(ry), int(ry)+1):
w = sqrt(max(0, rx*rx*(1-h*h/ry/ry)))
x1, x2 = int(x - w), int(x + w)
yc = int(y + h)
set_pixel(x1, yc, c)
set_pixel(x2, yc, c)
for w in range(-int(rx), int(rx)+1):
h = sqrt(max(0, ry*ry*(1-w*w/rx/rx)))
y1, y2 = int(y - h), int(y + h)
xc = int(x + w)
set_pixel(xc, y1, c)
set_pixel(xc, y2, c)
def fill_ellipse(x, y, rx, ry, c):
for h in range(-int(ry), int(ry)+1):
w = sqrt(max(0, rx*rx*(1-h*h/ry/ry)))
x1, x2 = int(x - w), int(x + w)
yc = int(y + h)
draw_line(x1, yc, x2, yc, c)
def draw_circle(x, y, r, c):
draw_ellipse(x, y, r, r, c)
def fill_circle(x, y, r, c):
fill_ellipse(x, y, r, r, c)
La construction des sapins utilise des similitudes, transformations géométriques conservant les rapports de distances.
Une similitude peut se décomposer en une isométrie (transformation conservant les distances : translation, rotation, ...) la plupart du temps suivie d'une homothétie (agrandissement ou réduction).
Plus précisément, en partant d'un couple de seulement 2 points que l'on va appeler le tronc, 5 similitudes sont appliquées pour créer 5 branches (en bas à gauche, à gauche, en haut, à droite, en bas à droite).
En itérant le même processus sur chacune de ces branches, on fait ainsi pousser l'arbre, le développant dans ces 5 directions.
![](https://i.imgur.com/jBZaNgPt.png)
- 1 itération
- 3 itérations
- 5 itérations (profitant pleinement des 1 Mio de mémoire de tas Python
)
- 4 itérations
- 3 itérations
![](https://i.imgur.com/nkBbLglt.png)
- 0 itération (donc le tronc initial nu)
- 1 itération (donc le tronc avec ses 5 branches initiales)
- 3 itérations
- 2 itérations
- 0 itération
- Code: Select all
from math import pi, sin, cos, exp, sqrt
import matplotlib.pyplot as plt
from random import *
from casioplot import *
def init_casioplot():
global color_screen, screen_w, screen_h
set_pixel(0, 0, (0, 0, 255))
col = get_pixel(0, 0)
color_screen = col[0] != col[2]
screen_w, screen_h = color_screen and (384, 192) or (128, 64)
def transform(x, y):
f = screen_h * 45 // 64
return (x*f,screen_h-1-y*f)
def draw_line(x1, y1, x2, y2, c):
m, a1, b1, a2, b2 = 0, int(x1), int(y1), int(x2), int(y2)
if (x2 - x1) ** 2 < (y2 - y1) ** 2:
m, a1, a2, b1, b2 = 1, b1, b2, a1, a2
if min(a1, a2) != a1: a1, b1, a2, b2 = a2, b2, a1, b1
for k in range(a2 - a1 + 1):
a, b = a1 + k, int(b1 + (b2 - b1) * k / ((a2 - a1) or 1))
set_pixel((a, b)[m], (b, a)[m], c)
def draw_ellipse(x, y, rx, ry, c):
for h in range(-int(ry), int(ry)+1):
w = sqrt(max(0, rx*rx*(1-h*h/ry/ry)))
x1, x2 = int(x - w), int(x + w)
yc = int(y + h)
set_pixel(x1, yc, c)
set_pixel(x2, yc, c)
for w in range(-int(rx), int(rx)+1):
h = sqrt(max(0, ry*ry*(1-w*w/rx/rx)))
y1, y2 = int(y - h), int(y + h)
xc = int(x + w)
set_pixel(xc, y1, c)
set_pixel(xc, y2, c)
def fill_ellipse(x, y, rx, ry, c):
for h in range(-int(ry), int(ry)+1):
w = sqrt(max(0, rx*rx*(1-h*h/ry/ry)))
x1, x2 = int(x - w), int(x + w)
yc = int(y + h)
draw_line(x1, yc, x2, yc, c)
def draw_circle(x, y, r, c):
draw_ellipse(x, y, r, r, c)
def fill_circle(x, y, r, c):
fill_ellipse(x, y, r, r, c)
def horiz_gradient(x, y, w, h, col1, col2):
for k in range(h):
draw_line(x, y + k, x + w - 1, y + k, [col1[i] + (col2[i] - col1[i])*k//(h-1) for i in range(3)])
def cmath_exp(a):
return exp(a.real) * (cos(a.imag) + 1j*sin(a.imag))
def similitude(u, v):
v = 1j * (u - v)
return lambda z: v*z + u
def generer_arbre(n):
lf = (
similitude(.2j, .2j + .5*cmath_exp(1j * pi / 7)),
similitude(.22j, .22j + .45j*cmath_exp(1j * pi / 3)),
similitude(.55j, .55j + .35*cmath_exp(1j * pi / 6)),
similitude(.57j, .57j + .3j*cmath_exp(1j * pi / 3)),
similitude(.7j, 1.2j - .01)
)
lz = [0j, 0.7j]
lz1 = lz[:]
for _ in range(n):
lz2 = []
for f in lf:
lz2.extend([f(z) for z in lz1])
lz.extend(lz2)
lz1 = lz2
return lz
def rotate_color(c):
return (c[1], c[2], c[0])
def trace(d, nb_trees, nb_balls, nb_stars, nb_flakes):
color_black = (0,) * 3
color = color_screen and (255,) * 3 or color_black
# fait tomber la nuit
colors = (color_black, (0, 0, 127), (0, 127, 255))
dy = screen_h / (len(colors))
if color_screen:
for k in range(len(colors) - 1):
horiz_gradient(0, round(dy*k), screen_w, round(dy), colors[k], colors[k + 1])
horiz_gradient(0, screen_h - 1 - round(dy), screen_w, round(dy), (0, 63, 127), color_black)
dx = (screen_w - 1) / 2 / (nb_trees - 1)
# allume les etoiles
for k in range(nb_stars):
set_pixel(randint(0, screen_w - 1), randint(0, screen_h - 1 - round(dy)), color)
# plante une foret de sapins
for p in range(d - nb_trees, d + 1):
x0 = screen_w // 2 + (p < d and dx * ((d - p) % 2 and d + 1 - p or p - d))
dy = screen_h / (len(colors)) * (d - p) / nb_trees
lz = generer_arbre(p)
for k in range(0, len(lz), 2):
x1, y1 = transform(lz[k].real, lz[k].imag)
x2, y2 = transform(lz[k+1].real, lz[k+1].imag)
x1 += x0
x2 += x0
draw_line(x1, y1 - dy, x2, y2 - dy, (0, 160 * (1 - (d - p)//(nb_trees - 1)), 0))
# decore mon plus beau sapin
if color_screen:
lz, r, color_in, color_out = lz[1::max(1, len(lz)//nb_balls)], 2, (0, 255, 255), (0, 0, 255)
for z in lz:
x, y = transform(z.real, z.imag)
x += x0
fill_circle(x, y, r, color_in)
draw_circle(x, y, r, color_out)
color_in, color_out = rotate_color(color_in), rotate_color(color_out)
# saupoudre de neige
if color_screen:
for k in range(nb_flakes):
fill_circle(randint(0, screen_w - 1), randint(0, screen_h - 1), 1, color)
init_casioplot()
trace(color_screen and 5 or 3, 5, 30, 100, 40)
show_screen()
![;) ;)](./images/smilies/wink.png)
On passe aux choses sérieuses, puisque Thomas nous annonce que Casio a classé son dessin en 2ème position !
![:D :D](./images/smilies/grin.png)
Thomas utilise ici le module de tracés relatifs turtle sur Graph 90+E pour nous dessiner un buste de renne.
Un tracé façon 3D fil de fer, décomposant très artistiquement le tout en triangles et quadrilatères telle une sculpture sur bois.
Le script profite avantageusement en taille de la symétrie verticale, n'ayant donc à décrire que le demi-buste qui sera itéré 2 fois.
Le plus remarquable c'est qu'une fois le tracé de chaque demi-buste commencé après un goto() et un couple penup/pendown() initial, à aucun moment la tortue ne se téléporte ou ne lève le stylo, superbe arabesque !
![Favorite :favorite:](./images/smilies/favorite.png)
![](https://i.imgur.com/lcrkFUMt.png)
- tête
- oreille
- cou
- poitrail
- bois
Toutes nos félicitations Thomas !
![:D :D](./images/smilies/grin.png)
- Code: Select all
from turtle import *
pensize(2)
for k in [-1,1]:
penup()
goto(0,-50)
pendown()
hideturtle()
setheading(90-90*k+30*k)
fd(19)
lt(90*k)
fd(10)
lt(60*k)
fd(10)
fd(-10)
lt(40*k)
fd(12)
fd(-12)
rt(100*k)
rt(15*k)
fd(10)
rt(15*k)
fd(10)
rt(40*k)
fd(15)
lt(140*k)
fd(17)
fd(-17)
rt(40*k)
fd(20)
fd(-20)
rt(100*k)
#oreille
lt(15*k)
fd(10)
lt(60*k)
fd(7)
lt(100*k)
fd(7)
fd(-7)
rt(210*k)
fd(25)
rt(163*k)
fd(25)
fd(-25)
lt(48*k)
fd(8)
rt(65*k)
fd(20)
fd(-20)
lt(50*k)
fd(20)
rt(115*k)
fd(15)
fd(-15)
lt(30*k)
fd(16)
fd(-16)
lt(30*k)
fd(13)
lt(90*k)
fd(5)
rt(110*k)
fd(10)
lt(30*k)
fd(10)
fd(-10)
rt(30*k)
fd(-10)
lt(90*k)
fd(20)
rt(120*k)
fd(7)
lt(10*k)
fd(12)
fd(-12)
rt(10*k)
fd(-7)
lt(130*k)
fd(9)
rt(60*k)
fd(5)
lt(45*k)
fd(50)
rt(165*k)
fd(52)
fd(-52)
lt(165*k)
#cou
lt(140*k)
fd(35)
lt(70*k)
fd(42)
fd(-42)
rt(30*k)
fd(29)
lt(45*k)
fd(32)
rt(40*k)
fd(5)
lt(22*k)
fd(13)
lt(20*k)
fd(15)
lt(40*k)
fd(11)
lt(108*k)
fd(49)
fd(-49)
# on est en haut de la tete
#bois
rt(108*k)
fd(-13)
#debut des bois
rt(110*k)
fd(10)
lt(90*k)
fd(6)
fd(-6)
rt(130*k)
fd(30)
lt(90*k)
fd(5)
fd(-5)
rt(60*k)
fd(20)
lt(90*k)
fd(5)
fd(-5)
rt(40*k)
fd(25)
lt(165*k)
fd(25)
rt(43*k)
fd(15)
rt(24*k)
fd(20)
fd(-20)
rt(120*k)
fd(15)
lt(90*k)
fd(5)
fd(-5)
rt(45*k)
fd(25)
lt(165*k)
fd(25)
rt(45*k)
fd(15)
rt(45*k)
fd(5)
rt(90*k)
fd(10)
lt(90*k)
fd(4)
fd(-4)
rt(120*k)
fd(15)
lt(165*k)
fd(15)
lt(30*k)
fd(15)
rt(75*k)
fd(15)
fd(-5)
rt(70*k)
fd(12)
lt(160*k)
fd(12)
rt(30*k)
fd(10)
Afyu nous apprend que c'est sa participation qui a été retenue par Casio en tant que meilleur dessin de Noël !
![Bien joué! :bj:](./images/smilies/sg3agbjg3ag.gif)
Afyu nous dessine ici toute une scène de Noël. Nous y retrouvons plusieurs éléments des participations précédentes :
- le sapin
- ses boules
- une étoile
- le renne, ici en entier
![:D :D](./images/smilies/grin.png)
![](https://i.imgur.com/nPC8Qwqt.png)
- le renne avec :
- sa patte arrière droite
- son dos
- ses oreilles
- ses bois
- sa tête
- son torse
- sa patte avant droite
- sa patte avant gauche
- son abdomen
- sa patte arrière gauche
- le traineau
- le harnais
- le sapin avec :
- son feuillage
- ses guirlandes
- ses boules
- son étoile
- les 4 paquets cadeaux avec pour chacun :
- la boîte
- le ruban
Et ce qu'il y a de remarquable ici c'est que l'on ne repère quasiment pas d'élément géométrique remarquable, témoin du soin et de la précision apportés au tracé !
![:o :o](./images/smilies/surprise.png)
Bravo Afyu, nous sommes très fiers de toi !
![Bien joué! :bj:](./images/smilies/sg3agbjg3ag.gif)
- Code: Select all
from turtle import *
hideturtle()
penup()
goto(-110,-50)
pendown()
#4 me patte
rt(40)
penup()
for i in range(30):
fd(1/4)
lt(1/2)
pendown()
for i in range(30):
fd(1)
rt(3-i/15)
for j in range(4):
for i in range(10):
fd(1/2)
lt(3)
lt(60)
lt(120)
for i in range(10):
fd(1/2)
rt(3)
lt(110)
for i in range(20):
fd(1)
rt(1.5)
#fd(30)
lt(50)
for i in range(25):
fd(0.6)
rt(2)
for i in range(15):
fd(1)
lt(3)
for i in range(30):
rt(12)
fd(1/2)
for i in range(15):
fd(1)
lt(4)
for i in range(30):
fd(1)
rt(i//10)
lt(30)
for i in range(40):
fd(1/2)
rt(i//10)
setheading(0)
penup()
fd(-15/2)
pendown()#les oreilles
for i in range(40):
fd(((400-10*i)//160)/2)
lt(4)
lt(290)
#for i in range(42):
#fd((10*i)//160)
#lt(4.2)
#penup()
#for i in range(42):
#fd(-(10*(28-i))//160)
#lt(-4.2)
#pendown()
for i in range(40):
fd(((10*i)//160)/2)
lt(4)
penup()
rt(90)
#fd(5)
lt(90)
fd(-5/2)
pendown()
#les bois
#penup()
rt(110)
fd(1)
#pendown()
rt(90)
for i in range(20):
fd(1)
rt(1)
lt(20)
for j in range(3):
rt(90)
#for i in range(20):
#fd(3)
#lt(2+20-2*i)
for i in range(10):
fd(3/2)
lt(2+10-i)
for i in range(4):
fd(1/2)
lt(36)
lt(10)
for i in range(9):
fd(1)
rt(1+2*i)
lt(40)
for i in range(80):
fd(1/2)
rt(2)
for i in range(10):
fd(1/2)
lt(18)
for i in range(30):
fd(1/2)
lt(1)
for i in range(20):
fd(1/2)
rt(3)
#fin des bois
penup()
setheading(-90)
fd(15/2)
lt(90)
fd(1)
pendown()
setheading(240)
pensize(2)
for j in range(2):
for i in range(40):
fd(1/12)
rt(3)
rt(60)
pensize(1)
setheading(90)
penup()
fd(15/2)
lt(90)
fd(1)
lt(75)
pendown()
rt(60)
for i in range(20):
fd(1/2)
lt(2)
lt(40)
for i in range(30):
fd(1/2)
rt((30-i)//7)
lt(70)
for j in range(4):
for i in range(10):
fd(1/2)
lt(5)
lt(40)
rt(0)
#for j in [1,-1]:
#for i in range(30):
#fd(j)
#lt(4*j)
fd(5/2)
rt(50)
fd(1)
lt(70)
for i in range(25):
fd(1)
lt((50-5*i)/3.7)
lt(70)
for j in range(2):
for i in range(10):
fd(1)
rt(2)
lt(40)
rt(50)
fd(7/2)
fd(-7/2)
rt(40)
#1 re patte
for j in range(2):
for i in range(30):
fd(1/2)
rt(1)
lt(70)
lt(20)
fd(5)
rt(200)
for j in range(4):
for i in range(10):
fd(1/2)
lt(3)
lt(60)
lt(100)
for j in range(2):
for i in range(30):
fd(-1/2)
rt(-1)
rt(70)
penup()
#2 me patte
#lt(90)
fd(15/2)
#pendown()
lt(100)
pendown()
for j in range(2):
for i in range(30):
fd(1/2)
rt(1)
lt(50)
lt(30)
fd(5)
rt(190)
for j in range(4):
for i in range(10):
fd(1/2)
lt(3)
lt(60)
lt(100)
for j in range(2):
for i in range(30):
fd(-1/2)
rt(-1)
rt(60)
#bas du corps
rt(90)
fd(5/2)
fd(-5/2)
rt(120)
for i in range(50):
fd(1/2)
lt(1/4)
lt(90)
penup()
fd(15/2)
pendown()
rt(190)
#3 me patte
for i in range(40):
fd(1/2)
lt(2-i/20)
rt(0)
for i in range(30):
fd(1/2)
rt((100-3*i)/30)
lt(0)
for j in range(4):
for i in range(10):
fd(1/2)
lt(3)
lt(60)
lt(120)
for i in range(10):
fd(1/2)
rt(3)
lt(90)
for i in range(30):
fd(1/2)
lt(1)
lt(10)
for i in range(30):
fd(1/2)
rt(1+i//15)
rt(20)
for i in range(30):
fd(1/2)
lt(1+i//15)
from turtle import *
hideturtle()
penup()
setheading(0)
pencolor([120/255,60/255,0])
pensize(3)
goto(-80,-40)
pendown()
rt(35)
for i in range(45):
fd(1/2)
rt(1)
rt(90)
#bois
pensize(3)
pencolor([120/255,60/255,0])
for i in range(30):
fd(1)
lt(6)
rt(10)
fd(5)
lt(90)
for i in range(4):
fd(10)
rt(90)
fd(3.5)
rt(90)
fd(10)
lt(90)
fd(20)
lt(90)
rt(90)
for i in range(10):
fd(0.6)
rt(18)
fd(47*2+5)
for i in range(28):
fd(1.45)
rt(6)
rt(84)
for i in range(20):
fd(1/2)
rt(1)
fd(7/2)
setheading(0)
fd(90)
#arri re
lt(90)
for i in range(30):
fd(3/2)
rt(i//10)
setheading(0)
for i in range(17):
fd(1/2)
lt(10)
fd(3/2)
penup()
fd(-3/2)
for i in range(17):
fd(-1/2)
lt(-10)
pendown()
setheading(160)
for i in range(38):
fd(3)
lt((15-i)/2)
for i in range(40):
fd(1/2)
lt((15-i))
penup()
setheading(0)
fd(105)
lt(90)
fd(20)
pendown()
setheading(160)
for i in range(38):
fd(3)
lt((15-i)/2)
for i in range(42):
fd(1/2)
lt((15-i))
lt(70)
fd(15/2)
pensize(2)
setheading(203)
for i in range(34):
fd(3)
rt(2-i/40)
from turtle import *
setheading(-30)
penup()
goto(110,-80)
hideturtle()
#pendown()
pencolor([0,205/255,0])
pensize(2)
for k in [-1,1]:
penup()
goto(110,-80)
setheading(90)
fd(15)
setheading(90-120*k)
fd(16)
pendown()
for j in range(4):
for i in range(30):
fd(1-j/5)
lt(k*(1+i//20))
rt(50*k)
for i in range(10):
fd(-1+j/5)
lt(k*(-1-i//20))
lt(50*k)
for i in range(50):
fd(1-j/5)
lt(k*(i/30))
rt(40*k)
for i in range(40):
fd(-1+j/5)
lt(k*(-i//20))
lt(70*k)
for i in range(10):
fd(1-j/5)
lt(k*(1+i//20))
rt(30*k)
for i in range(40):
fd(-1+j/5)
lt(k*(-1-i//30))
setheading(90-90*k-30*k+30*j*k)
setheading(90-50*k)
for i in range(30):
fd(1/2)
lt(k*(1+i//20))
rt(40*k)
for i in range(20):
fd(-1/3)
lt(k*(-1-i//20))
lt(50*k)
for i in range(30):
fd(1/2)
lt(k*(i/10))
rt(60*k)
for i in range(30):
fd(-1/3)
lt(k*(i/20))
lt(20*k)
for i in range(30):
fd(1/2)
lt(k*(1+i//20))
#guirlandes
penup()
goto(120,50)
pendown()
pencolor([1,0,0])
setheading(-140)
for i in range(6):
pensize(5)
fd(3)
pensize(2)
fd(3)
rt(5)
setheading(-50)
for i in range(10):
pensize(5)
fd(3)
pensize(2)
fd(3)
lt(6)
setheading(-150)
for i in range(12):
pensize(5)
fd(3)
pensize(2)
fd(3)
rt(4)
setheading(-60)
for i in range(13):
pensize(5)
fd(3)
pensize(2)
fd(3)
lt(6)
setheading(-120)
for i in range(15):
pensize(5)
fd(3)
pensize(2)
fd(3)
rt(6)
setheading(-50)
for i in range(13):
pensize(5)
fd(3)
pensize(2)
fd(3)
lt(6)
#boules
from random import randint
for coord in [(17,32),(-17,24),(-60,-10),(15,0),(-30,-40),(40,-50)]:
penup()
goto(coord[0]+110,coord[1]-10)
pensize(20)
pencolor([randint(1,10)/10,randint(1,10)/10,randint(1,10)/10])
pendown()
fd(1)
#etoile
penup()
goto(100,80)
pendown()
pencolor([220/255,220/255,40/255])
pensize(5)
setheading(0)
for i in range(5):
fd(20)
rt(72*2)
#paquets
from random import randint
for coord in [(0,20),(-30,-10),(-70,10),(-30,50)]:
penup()
goto(coord[0],coord[1])
pendown()
pensize(7/2)
pencolor([randint(1,10)/10,randint(1,10)/10,randint(1,10)/10])
setheading(randint(1,60)-30)
for i in range(4):
fd(20)
lt(90)
fd(20)
lt(45)
fd(15/2)
lt(45)
fd(20)
lt(135)
fd(15/2)
fd(-15/2)
rt(45)
fd(20)
lt(45)
fd(15/2)
penup()
lt(45)
pencolor([randint(1,10)/10,randint(1,10)/10,randint(1,10)/10])
pensize(7/2)
fd(10)
#pendown()
lt(90)
fd(20)
lt(45)
fd(15/2)
fd(-7/2)
pendown()
pensize(5/2)
lt(45)
fd(-10)
fd(20)
lt(90)
fd(20)
fd(-20)
rt(90)
fd(-10)
rt(45)
pensize(7/2)
penup()
fd(-4)
rt(45)
fd(-10)
pendown()
lt(90)
fd(-10)
fd(20)
#ruban
rt(45)
fd(7/2)
rt(15)
for j in range(2):
for i in range(30):
fd(1/2)
lt(2)
lt(120)
for i in range(30):
fd(1/2)
lt(2)
rt(180)
![:D :D](./images/smilies/grin.png)
Un concours de plus à la dotation fort appréciée. On aime la présence de plusieurs gros lots, la possibilité pour les gagnants de personnaliser en partie leur gros lot (choix de la calculatrice), l'absence de perdant, et justement en lot de participation les goodies exclusifs !
![Bien joué! :bj:](./images/smilies/sg3agbjg3ag.gif)
Merci Casio d'avoir égayé notre mois de décembre avec un peu de magie de Noël en cette période difficile.
![Favorite :favorite:](./images/smilies/favorite.png)
Du grand art, reproduire un tel événement en ouvrant la participation aux élèves pourra être une excellente idée bien sûr en des temps plus propices.
![;) ;)](./images/smilies/wink.png)
Téléchargements :