Escolar Documentos
Profissional Documentos
Cultura Documentos
"♥♥♥♥♥♥",banco_geral,banco_geral2,level,bot_banco,mostrarbot="",posbot=0,myturn=tru
e;
//Começo do jogo
banco_geral = "";
bot_banco = "ABCDEFGHIJLMNOPQRSTUV";
banco = " BRASIL RUSSIA PORTUGAL ESPANHA MARROCOS CROACIA ALBANIA LETONIA ESTONIA
EQUADOR GRECIA FINLANDIA NORUEGA COLOMBIA ALEMANHA JORDANIA GEORGIA DINAMARCA
ISRAEL SUDAO PALAU PANAMA PAQUISTAO ROMENIA IRLANDA";
banco2 = " ESTADOS_UNIDOS COREIA_DO_SUL MACEDONIA_DO_NORTE AFRICA_DO_SUL
ARABIA_SAUDITA REPUBLICA_CHECA BOSNIA_E_HERZEGOVINA CABO_VERDE COREIA_DO_NORTE
COSTA_DO_MARFIM PORTO_RICO EMIRADOS_ARABES_UNIDOS REPUBLICA_DEMOCRATICA_DO_CONGO
PAPUA_NOVA_GUINE REPUBLICA_DOMINICANA SUDAO_DO_SUL TRINDADE_E_TOBAGO TIMOR_LESTE
SRI_LANCA SERRA_LEOA SAO_VICENTE_E_GRANADINAS SAO_MARINHO SANTA_LUCIA REINO_UNIDO
PAISES_BAIXOS"
resp = prompt("Gostaria de jogar um jogo da forca? [Y/N]");
resp = resp.toUpperCase();
if (resp === "Y" || resp === "YES") {
level = Number(prompt("Escolha um dos níveis: " + "\n".repeat(1) +
"SIMPLES [1]" + "\n" + "COMPLEXO [2]"));
switch(level) {
case 1:
banco_geral = banco;
break;
case 2:
banco_geral = banco2;
break;
case 6:
alert("REPROGRAMANDO O JOGO");
var pos, display = "⧠⧠⧠⧠⧠⧠⧠⧠⧠", resp, choose,
sequencia = false,myturn = true,sequencia2 = false,choose2;
}
pos = Math.ceil(Math.random()*banco_geral.length);
if (banco_geral.indexOf(" ",pos) === -1) {
forca = banco_geral.substring(banco_geral.lastIndexOf(" ",pos) +
1,banco_geral.length);
} else {
mostrar = mostrar.substr(0, i) +
forca.charAt(i) + mostrar.substr(i + 1);
letra_certa = true;
myturn = false;
}
}
if (!letra_certa && erros.indexOf(resp2) === -1 &&
resp2.length == 1) {
case 1:
banco_geral = banco;
break;
case 2:
banco_geral = banco2;
break;
case 6:
alert("REPROGRAMANDO O JOGO");
var pos, display = "⧠⧠⧠⧠⧠⧠⧠⧠⧠",
resp, choose, sequencia = false,myturn = true,sequencia2 = false,choose2;
}
pos = Math.ceil(Math.random()*banco_geral.length);
forca = "";
erros = "";
mostrar = "";
lives = "♥♥♥♥♥♥";
bot_banco = "ABCDEFGHIJLMNOPQRSTUV";
if (banco_geral.indexOf(" ",pos) === -1) {
forca =
banco_geral.substring(banco_geral.lastIndexOf(" ",pos) + 1,banco_geral.length);
} else {
forca =
banco_geral.substring(banco_geral.lastIndexOf(" ",pos)+1,banco_geral.indexOf("
",pos+1));
}
for (var i =0;i<forca.length;i++) {
if (forca.charAt(i) == "_") {
case 1:
banco_geral = banco;
break;
case 2:
banco_geral = banco2;
break;
case 6:
alert("REPROGRAMANDO O JOGO");
var pos, display = "⧠⧠⧠⧠⧠⧠⧠⧠⧠",
resp, choose, sequencia = false,myturn = true,sequencia2 = false,choose2;
pos = Math.ceil(Math.random()*banco_geral.length);
forca = "";
erros = "";
mostrar = "";
lives = "♥♥♥♥♥♥";
bot_banco = "ABCDEFGHIJLMNOPQRSTUV";
if (banco_geral.indexOf(" ",pos) === -1) {
forca =
banco_geral.substring(banco_geral.lastIndexOf(" ",pos) + 1,banco_geral.length);
} else {
forca =
banco_geral.substring(banco_geral.lastIndexOf(" ",pos)+1,banco_geral.indexOf("
",pos+1));
}
for (var i =0;i<forca.length;i++) {
if (forca.charAt(i) == "_") {
if (mostrar.indexOf("?") == -1) {
case 1:
banco_geral = banco;
break;
case 2:
banco_geral = banco2;
break;
case 6:
alert("REPROGRAMANDO O JOGO");
var pos, display = "⧠⧠⧠⧠⧠⧠⧠⧠⧠", resp,
choose, sequencia = false,myturn = true,sequencia2 = false,choose2;
}
pos = Math.ceil(Math.random()*banco_geral.length);
lives = "♥♥♥♥♥♥"
bot_banco = "ABCDEFGHIJLMNOPQRSTUV";
forca = "";
erros = "";
mostrar = "";
if (banco_geral.indexOf(" ",pos) === -1) {
forca = banco_geral.substring(banco_geral.lastIndexOf("
",pos) + 1,banco_geral.length);
} else {
forca =
banco_geral.substring(banco_geral.lastIndexOf(" ",pos)+1,banco_geral.indexOf("
",pos+1));
}
for (var i =0;i<forca.length;i++) {
if (forca.charAt(i) == "_") {