Javascript > and <
Hello !...
I want to create a "longest word game"... (Thanks to Greg's ressources...)
I manage to change the state of the letters without any problem...
But I try to give the letters a % of appearance... For example in french the voyel "E" appears far more often than the "Y" (which is a voyel in french !!)...
So that is for example my javascript for the choose of the voyel in % :
var num = Math.floor(Math.random() * 100) + 1;
if num <= 20 {
cp.changeState("SS_9_30_01","Lettre_"+1); // corresponds to A
}
else if num > 20 && num <= 50 {
cp.changeState("SS_9_30_01","Lettre_"+2); // corresponds to E
}
else if num > 50 && num <= 70 {
cp.changeState("SS_9_30_01","Lettre_"+3); // corresponds to I
}
else if num > 70 && num <= 83 {
cp.changeState("SS_9_30_01","Lettre_"+4); // corresponds to O
}
else if num > 83 && num <= 95 {
cp.changeState("SS_9_30_01","Lettre_"+5); // corresponds to U
}
else if num > 95 {
cp.changeState("SS_9_30_01","Lettre_"+6); // corresponds to Y
}
But when I write or copy this code in the javascript action panel of Captivate, it changes my "<=" in this ": <=" every time I try to save the code... which doesn't work obviously !...
So I need some help !... Thanks in advance !...
😉
