So what I'm getting from your code is that Alice may be getting confused by the world.record property. I'd say (if you're new to Alice) try the if/else statements that I mentioned earlier, (without the random code part) and don't try to work with lists/arrays yet. I don't fully understand them, nor will I pretend to, but I think that for clarity's sake, and for readability, you might want to try using methods with if/else statements that are done in order, asking for the user to click on certain buttons in order. Once you have a reliable code down for 2-3 patterns, re-write the code for randomly choosing one of those patterns, then one you're comfortable with that, ask around for helps with lists. I'm having a bit of difficulty understanding your code anyways, but if someone else wants to give it a try, they can feel free to do so.
As for getting the code to run reliably, the if/else statements might be your best bet for now. Sorry I couldn't help too much! I can't wait to see more from this code though, it looks really interesting!
Hogwarts: Where everything is made up, and the points don't matter
This is what I have now and it works pretty well. The problem however is for patterns that use a button more than once. As long as the button is pressed one time, the program thinks the pattern is correct. Is there a way around this?