Help with optimising a game to play at a more acceptable speed

I have been working on a game right now called 'Word Memory Game' (Work in progress) and I have realised that it quickly becomes laggy after a few successive words.

Start/restart the game with Space and click on the left if it's the first time the game has shown the word, otherwise click on the right. Repeat until you lose.

I believe a large portion of the lag comes from how I verify if the word has appeared before. I keep a list of all words that appear in the game in order. Then, when I need to check if it's the first time the current word has appeared, I compare the Index of the word in the list and the total length of the list. If they are the same the word has only appeared once. Does anyone know a more efficient way to do this?

https://snap.berkeley.edu/project?user=odysseus_ssb&project=Word%20Memory%20Game

Sure, do the check before you add the word to the list, and then you can use the CONTAINS block. It'll still slow down a little as the list grows, but not very much, unless you get a player who can remember thousands of words!

Ok so the 'Contains' block isn't just a 'Index is not equalto zero' block?

I felt lazy so I'm just using
untitled script pic (7)
until I've had a good sleep then I'll put effort in

CONTAINS way predates INDEX. It's very fast.

Okay thanks. I got 46, so Im thinking I'll make it remember your top score (via cookie?)

Import the database library so you can save values in the browser

Or just use the db_store/db_get primitives.

...that the database library uses itself.

Yep. I personally like using primitives better (unless it is absolutely necessary ∨ I don't understand all of the inputs and the libraries help me utilize them better) because you have all of the library functions and more at your fingertips. That doesn't mean anyone else has to, I just think checking a box is easier than loading every library your project uses.