Probleme exercice pierre feuille ciseaux

#1

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

SyntaxError unexpected token {

```

var choixUtilisateur = prompt(“Pierre, feuille, ciseau ?”);
var choixOrdi = Math.random();

if((choixOrdi >= 0 ) && ( choixOrdi <= 0.33 )){
console.log(“Pierre”);
}
else if((choixOrdi >= 0.34 ) && (choixOrdi <= 0.66 )){
console.log(“Feuille”);
}
else ((choixOrdi >= 0.67 ) && (choixOrdi <= 1 )){
console.log(“Ciseau”);
}

``<do not remove the three backticks above>``

#2

else statements don’t have a condition
so write “else if” instead of just “else”

should be like-

``````else if ((choixOrdi >= 0.67 ) && (choixOrdi <= 1 )){
console.log("Ciseau");
``````

else use for default value or statement
if you don’t need any default value or statement, dont need to write it.
@megacoder81601

#3

when i dont use statment for else i have this error message which said, else must have statment 0.67 and 1.

#4

erreur d’orthographe
you just missed “x”
“Ciseaux” not “Ciseau”

console.log(“Ciseau”); <= write “Ciseaux”

ok???

@megacoder81601

#5

Try this :

var choixUtilisateur = prompt(“Pierre, feuille, ciseau ?”);
var choixOrdi = Math.random();

if((choixOrdi >= 0 ) && ( choixOrdi <= 0.33 ))
{
console.log(“Pierre”);
}
else if((choixOrdi >= 0.34 ) && (choixOrdi <= 0.66 ))
{
console.log(“Feuille”);
}
else ((choixOrdi >= 0.67 ) && (choixOrdi <= 1 ))
{
console.log(“Ciseau”);
}