-
Notifications
You must be signed in to change notification settings - Fork 0
/
first.lsa
50 lines (41 loc) · 1013 Bytes
/
first.lsa
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
#Ceci est une fonction qui dessine une maison
create subprogram house(var x, var y, var w, var h)
create var ratio
ratio = 0.3
draw_triangle(x,y+h*ratio, x+w,y+h*ratio, x+w/2,y)
draw_rectangle(x, y+h*ratio, w, h*(1-ratio))
draw_line(1,1,100,100, color=Color(255,0,0))
create subprogram test(var a, var b)
draw_ellipse(x*a, b, 10, 10)
x = 5
draw_ellipse(x*a, b+10, 10, 10)
create var x
create var y
# On attribue 1 la variable x
#and so
x = 1
change_color(0, 0, 255)
draw_ellipse(5, 5, 10, 10)
draw_rectangle(20, 5+x*2, 15, 5)
change_color(255, 255, 0)
do test(5, 20)
draw_rectangle(20, 5+x*2, 15, 5)
change_color(255, 0, 255)
do house(15, 50, 15, 35)
change_color(0, 255, 0)
draw_quad(50,10, 50,20, 60,20, 60,10)
change_color(0, 255, 255)
if x == 5
change_color(0, 255, 0)
x = 0
loop 3 times
draw_rectangle(50+10*x, 25+2*x, 10, 10)
x = x + 1
x=0
loop 10 times
y = 0
loop x times
change_color(25*x, 50*y, 0)
draw_rectangle(50+5*x, 50+5*y, 3, 3)
y = y + 1
x = x + 1