-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
59 lines (49 loc) · 1.19 KB
/
test.js
File metadata and controls
59 lines (49 loc) · 1.19 KB
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
let a = 0
let c=0
let d=0
function getRandomInt(max) {
a = Math.floor(Math.random() * max);
}
console.log(getRandomInt(1000));
b = prompt(`Devinez le nombre`)
while (c == 0){
if (b>a){
d=d+1
b=prompt(`c'est moins`)
}
else if (b<a){
d=d+1
b=prompt(`c'est plus`)
}
else if (b==a){
c=1
console.log(`Félicitation, vous avez gagné. Le nombre était : `, a, `Vous avez fait `,d, `erreurs`)
}
else if (b !== a){
c=1
console.log(`Le caractere `,b,` n'est pas valide`)
}
}
// ----------------------------------------------------------
// function candrive (age, pays) {
// if (
// (age >= 18 && pays === `FR`) ||
// (age >= 16 && pays === `US`)
// ) {
// return true
// }
// return false
// }
// console.log(candrive(19, `FR`))
// const a = {
// firstname: `John`,
// lastname:`Doe`,
// fullname: function (){
// console.log(this.firstname, this.lastname)
// }
// }
// const mafonction = (p1, p2) =>{
// console.log(p1, p2)
// }
// mafonction(1,2)
https://prod.liveshare.vsengsaas.visualstudio.com/join?0C89C3FFECF164A6AE3F5E444503AB3EFAFD