const myImage = document.getElementById("OLBild");
const myLabel = document.getElementById("Beschreibung");
const myText = document.getElementById("Antwort");
const myButton = document.getElementById("Knopf");
const answers = [
    ["images/OLBild_01.jpg","left"],
    ["images/OLBild_02.jpg","75"],
    ["images/OLBild_03.jpg","Tom"],
    ["images/OLBild_04.jpg","9"],
    ["images/OLBildSieg.jpg", "aposdi"]
];

if (!localStorage.progress){
    localStorage.progress = 0;
}

myImage.src = answers[parseInt(localStorage.progress)][0];

function checkAnswer() {
    let progress = parseInt(localStorage.progress);
    if (progress>=answers.length){localStorage.progress=0}
    if (myText.value === answers[progress][1]){
        localStorage.progress = progress+1;
        console.log(localStorage.progress)
    } else {
        localStorage.progress = 0;
    }
    myImage.src = answers[parseInt(localStorage.progress)][0];
    myText.value="";
}