Skip to content

Commit 7977116

Browse files
committed
[NEW] Exercice 32
1 parent ab7a04e commit 7977116

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

Exercice_32/exercice32.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/****************************************** EXERCICE 32 *******************************************/
2+
3+
var tabFeu = ["_", "_", "_"];
4+
5+
// Feu rouge
6+
setTimeout(function () {
7+
tabFeu[0] = "x";
8+
console.log(tabFeu[0] + " | " + tabFeu[1], " | " + tabFeu[2]);
9+
console.log("------------------");
10+
}, 2000);
11+
12+
// Feu vert
13+
setTimeout(function () {
14+
tabFeu[0] = "_";
15+
tabFeu[2] = "x";
16+
console.log(tabFeu[0] + " | " + tabFeu[1], " | " + tabFeu[2]);
17+
console.log("------------------");
18+
}, 4000);
19+
20+
// Feu orange
21+
setTimeout(function () {
22+
tabFeu[2] = "_";
23+
tabFeu[1] = "x";
24+
console.log(tabFeu[0] + " | " + tabFeu[1], " | " + tabFeu[2]);
25+
console.log("------------------");
26+
}, 4500);

Exercice_32/exercice32.pseudoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/****************************************** EXERCICE 32 *******************************************/
2+
3+
ALGORITHME main
4+
VARIABLE
5+
tabFeu[c] : TABLEAU CHAINE DE CARACTERE
6+
DÉBUT
7+
tabFeu → ["_", "_", "_"]
8+
9+
// Feu rouge
10+
tabFeu[0] → "x"
11+
AFFICHER tabFeu[0], " | ", tabFeu[1], " | ", tabFeu[2]
12+
AFFICHER "------------------"
13+
attendre(2000)
14+
15+
// Feu vert
16+
tabFeu[0] → "_"
17+
tabFeu[2] → "x"
18+
AFFICHER tabFeu[0], " | ", tabFeu[1], " | ", tabFeu[2]
19+
AFFICHER "------------------"
20+
attendre(2000)
21+
22+
// Feu orange
23+
tabFeu[2] → "_"
24+
tabFeu[1] → "x"
25+
AFFICHER tabFeu[0], " | ", tabFeu[1], " | ", tabFeu[2]
26+
AFFICHER "------------------"
27+
attendre(500)
28+
FIN

0 commit comments

Comments
 (0)