Hello
So I'm trying to make the game 'Simon Says' for a school assignment and Im experiencing some issues.
When Im running the app, I get an error saying 'trying to remove item 1 from an empty list'.
I was hoping if someone could help me out.
Thanks in advance
In your showOldItems procedure, you check to see if the list is empty and then proceed to call pickNewItem, which tries to get items from the empty list. Either don't call pickNewItem or repopulate your list with items before the call.
The moment I press Start the first square gets indicated.
Then after a short time I get an error
My guess is that I have to make a function that inserts an answer before it continues.
the list of Computer choices, growing by 1 item each successful round
a temporary copy of the Computer choices list for the timed display sequence, flashing and depleting item 1 each timer cycle until empty
a temporary copy of the Computer choices for the player to nibble away until empty, guessing item 1 (if not empty list) then either removing item1 if success, else replenishing the timed display list and the to-guess list if wrong. If correct guess and the guess list is now empty, add a new random item to the Computer choice list.
This approach eliminates the need for counter variables and index variables, since you always work with just item 1 (if not empty).