kkkkkkk

#hero-game-scope {
display: block;
background: #0f172a;
color: white;
padding: 20px;
border-radius: 15px;
max-width: 600px;
margin: 20px auto;
text-align: center;
}
.hero-card {
background: #1e293b;
border: 2px solid #475569;
padding: 20px;
border-radius: 15px;
margin-top: 20px;
}
.hero-input {
background: #334155;
border: 1px solid #64748b;
color: white;
padding: 10px;
width: 90%;
margin: 5px 0;
border-radius: 8px;
text-align: center;
}
.hero-btn {
background: #0284c7;
color: white;
border: none;
padding: 12px 25px;
border-radius: 8px;
cursor: pointer;
font-weight: bold;
margin-top: 10px;
}
.hero-btn-lvl {
background: #334155;
color: white;
border: 1px solid #475569;
padding: 15px;
margin: 5px;
cursor: pointer;
width: 100%;
border-radius: 10px;
}
.hidden { display: none !important; }
#hero-hint { color: #f87171; margin-top: 10px; font-size: 0.9rem; }

IRREGULAR HERO

4º ESO Verbs



const hVerbs = {
easy: [{i:’be’, p:[‘was’,’were’], r:’been’, m:’ser/estar’}, {i:’do’, p:’did’, r:’done’, m:’hacer’}, {i:’go’, p:’went’, r:’gone’, m:’ir’}],
medium: [{i:’break’, p:’broke’, r:’broken’, m:’romper’}, {i:’speak’, p:’spoke’, r:’spoken’, m:’hablar’}, {i:’write’, p:’wrote’, r:’written’, m:’escribir’}],
hard: [{i:’arise’, p:’arose’, r:’arisen’, m:’surgir’}, {i:’shrink’, p:’shrank’, r:’shrunk’, m:’encoger’}, {i:’withdraw’, p:’withdrew’, r:’withdrawn’, m:’retirar’}]
};
let hList = [], hIdx = 0, hPts = 0;

function hStart(lvl) {
hList = […hVerbs[lvl]].sort(() => Math.random() – 0.5);
hIdx = 0; hPts = 0;
document.getElementById(‘sc-start’).classList.add(‘hidden’);
document.getElementById(‘sc-game’).classList.remove(‘hidden’);
hLoad();
}

function hLoad() {
const v = hList[hIdx];
const inputs = [‘h-inf’, ‘h-past’, ‘h-part’];
inputs.forEach(id => {
const el = document.getElementById(id);
el.value = »; el.disabled = false; el.style.background = ‘#334155’;
});
document.getElementById(‘h-main’).innerText = v.m;
document.getElementById(‘h-sub’).innerText = ‘Escribe las 3 formas’;
document.getElementById(‘h-score’).innerText = hPts;
document.getElementById(‘hero-hint’).innerText = »;
}

function hCheck() {
const v = hList[hIdx];
const i = document.getElementById(‘h-inf’).value.trim().toLowerCase();
const p = document.getElementById(‘h-past’).value.trim().toLowerCase();
const r = document.getElementById(‘h-part’).value.trim().toLowerCase();
const isP = Array.isArray(v.p) ? v.p.includes(p) : p === v.p;

if (i === v.i && isP && r === v.r) {
hPts += 100; hIdx++;
if (hIdx < hList.length) hLoad();
else {
document.getElementById('sc-game').classList.add('hidden');
document.getElementById('sc-end').classList.remove('hidden');
document.getElementById('h-final').innerText = hPts;
}
} else {
document.getElementById('hero-hint').innerText = 'Error. Inténtalo de nuevo.';
}
}

También te podría gustar...

Deja una respuesta

Descripción general de privacidad

Este sitio web utiliza cookies para que podamos brindarle la mejor experiencia de usuario posible. La información de las cookies se almacena en su navegador y realiza funciones como reconocerlo cuando regresa a nuestro sitio web y ayudar a nuestro equipo a comprender qué secciones del sitio web le resultan más interesantes y útiles.