Lesson 4


#1

hello i don't know where's the mistake in my code :

choixUtilisateur = prompt("Choisissez-vous pierre, feuille, ou ciseaux ?");
choixOrdi = Math.random();
console.log(choixOrdi);
if (0<=choixOrdi<=0.33) {
choixOrdi = "pierre";}
else if (0.33 choixOrdi = "feuille";}
else (0.66 choixOrdi = "ciseaux";}
console.log (choixOrdi);

can someone tell me where i've done wrong ?
thanks


#2

Well i think you should pretty much write the code in english


#3

sure but i"m french and the lesson is in my native language and so the contol too. if i try to write the code in english i won"t oass trought


#4

The lession is in your native language but the coding itself is in English


#5

ok but i still got this message even in english : SyntaxError: Unexpected token {


#6

by the way here is my new code ( in french again for the variables)

choixUtilisateur = prompt("Choisissez-vous pierre, feuille, ou ciseaux ?");
choixOrdi = Math.random();
if (0 choixOrdi = "pierre";}
else if (0.33 choixOrdi = "feuille";}
else (0.66 choixOrdi = "ciseaux";}
console.log("vous : " + choixUtilisateur);
console.log ("ordi : " + choixOrdi);

thanks for helping


#7

here it is don't know why the < doesn't appear above


#8

The else statement doesn't take a condition.


#9

I think the semi - colon's should be after the closing }


#10

Check your syntax. How do you close a condition? Does a condition take a semicolon? Make sure these are corrected.


#11

voici mon code dans le copier-coller de tout a l heure je ne sais pas ce qu il c 'est passe mais le rendu n avait rien a voir avec l original


#12

et voici ce que cela donnait avant que je ne sorte les points virgules des accolades


#13

sorry to answered you in french here is my code with the semicolon in and out the condition


#14

Line 7, remove the condition.


#15

thanks it works but i had to put the semicolon before the } to make it pass


#16

Wrong. This is not helpful advice.


#17

Fifteen posts and the elephant is still in the room. I don't know whether to laugh or go fishing.

if ( c < 1/3) {

}
else if ( c < 2/3) {

}
else {

}

#18

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.