mise à jour des tests

This commit is contained in:
Dimitri Lajou
2025-03-27 14:18:02 +01:00
parent 89abf8f85a
commit eef8242f11
142 changed files with 165 additions and 36 deletions

View File

@@ -0,0 +1,4 @@
7
3
1

View File

@@ -0,0 +1 @@
731

5
tests/fragment3/tab1.vsl Normal file
View File

@@ -0,0 +1,5 @@
FUNC VOID main() {
INT x, t[3]
READ t[0],t[1],t[2]
PRINT t[0], t[1], t[2]
}

View File

@@ -0,0 +1,4 @@
8
4
2

View File

@@ -0,0 +1,3 @@
t[0] = 8
t[1] = 4
t[2] = 2

8
tests/fragment3/tab2.vsl Normal file
View File

@@ -0,0 +1,8 @@
FUNC VOID main() {
INT x,y,z, t[3]
READ x,y,z
t[0] := x
t[1] := y
t[2] := z
PRINT "t[0] = ", t[0],"\nt[1] = ", t[1],"\nt[2] = ",t[2]
}

View File

@@ -0,0 +1,9 @@
8
4
6
2
5
1
3
7

View File

@@ -0,0 +1,8 @@
t[0] = 8
t[1] = 4
t[2] = 6
t[3] = 2
t[4] = 5
t[5] = 1
t[6] = 3
t[7] = 7

19
tests/fragment3/tab3.vsl Normal file
View File

@@ -0,0 +1,19 @@
FUNC VOID main() {
INT i, t[8],x
i := 0
WHILE 8-i DO {
READ x
t[i] := x
i:= i+1
} DONE
i := 0
WHILE 8-i DO {
PRINT "t[",i,"] = ",t[i],"\n"
i:= i+1
} DONE
}

View File

@@ -0,0 +1,9 @@
7
6
5
1
2
3
4
9

View File

@@ -0,0 +1 @@
Tableau de taille 8 = [7,6,5,1,2,3,4,9]

24
tests/fragment3/tab4.vsl Normal file
View File

@@ -0,0 +1,24 @@
PROTO VOID printtab(s,t[])
FUNC VOID main() {
INT i, t[8],x
i := 0
WHILE 8-i DO {
READ x
t[i] := x
i:= i+1
} DONE
printtab(8,t)
}
FUNC VOID printtab(size,t[]) {
INT i
PRINT "Tableau de taille ", size," = ["
i := 0
WHILE size-i DO {
IF i THEN PRINT "," FI
PRINT t[i]
i:= i+1
} DONE
PRINT "]\n"
}

View File

@@ -0,0 +1,3 @@
10
20

View File

@@ -0,0 +1,3 @@
entrezno :0 entrezno :1 Tableau de taille 2 = [10,20]
Main: Tableau de taille 2 = [10,20]
Fini

37
tests/fragment3/tab5.vsl Normal file
View File

@@ -0,0 +1,37 @@
PROTO VOID readprinttab(s,t[])
FUNC VOID main() {
INT i,s,t[2]
s := 2
readprinttab(s,t)
PRINT "Main: Tableau de taille ",s," = ["
i := 0
WHILE s-i DO {
IF i THEN PRINT "," FI
PRINT t[i]
i:= i+1
}
DONE
PRINT "]\n"
PRINT "Fini"
}
FUNC VOID readprinttab(size,t[]) {
INT i
i := 0
WHILE size-i DO {
PRINT "entrezno :",i," "
READ t[i]
i:= i+1
}
DONE
PRINT "Tableau de taille ",size," = ["
i := 0
WHILE size-i DO {
IF i THEN PRINT "," FI
PRINT t[i]
i:= i+1
}
DONE
PRINT "]\n"
}