Commit 58bdafb2 authored by pet's avatar pet

fix

parent f24b39b3
......@@ -225,11 +225,16 @@ function clicou(cor){
}
}
var lastChoice = -1;
function mudaCor(c_i){
var rand;
var rand2;
if (c_i == "C" || c_i == "pC"){ // PRIMEIRA METADE É CONGRUENTE
rand = Math.floor(Math.random() * 5);
if(rand == lastChoice){
rand = (rand+1) % 5;
}
lastChoice = rand;
switch(rand) {
case 0: // VERMELHO
document.getElementById("label").style.color = "#ff0000";
......@@ -284,8 +289,12 @@ function mudaCor(c_i){
}
do {
rand2 = Math.floor(Math.random() * 5);
if(rand2 == lastChoice){
rand2 = (rand+1) % 5;
}
lastChoice = rand2;
} while (rand2 == rand);
switch(rand2) {
case 0: // VERMELHO
document.getElementById("label").innerHTML = "Vermelho";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment