Hey!
I have some troubles with comparing two lists. First heres the important part of my code:
Problem:
in round 1 it works, but in round 2, the game is setting the variable "Spielende" true, just when I pressed one color (so one value is setted in the list) without waiting on the second value.
Its a Color Memory game. The computer set values (they stand for colors) in the list game and the player must repeat the order of the colors. The colors which the player press, will be wrote into the list player.
I dont know why the game set "Spielende" true because, i just pressed one color.
You know what I mean and can help me?
if(player.size() == game.size()){ //prüft ob die Listengrößen übereinstimmen if(game.equals (player)) //Wenn game und player Liste übereinstimmen ... { Spielende = false; //... bleibt das Spielende false ... sequenz = runden + 1; /** Wird sequenz um 1 erhöht * sorgt dafür das die anfangsschleife nicht * unterbrochen und fortgeführt wird */ beg = 0; } else {Spielende = true; //.. wenn nicht, tritt das Spielende ein }