Simon Calculator, how to make program wait for user input

I’m doing the simon calculator and I’m stuck on getting the program to wait for a user to press a button.
Basically I want the flow to be

//Computer presses button function
//Player presses button function
//Checks if player made right move function

How do I get the third function to wait for the second function to have a value before it checks if it is the right move?
https://codepen.io/amthomps/pen/YrZrBK?editors=0111

  1. Didn’t realize, I was messing around with my code for a while to no avail before I posted this and made some things sloppy in the process.

  2. Well I’m trying to use two different queues to store the sequence of moves that the computer makes and that the player makes. SO what I tried to do with these lines (and I realize it doesn’t do what I want) was to have the player make a move with the function humanPress() and load the returned value into pmove. I then want to put pmove in the player queue of moves. The for loop is going to be used to make however many moves depending on how far the player is in the game.

Thank you so much, you really went above and beyond helping me with this one.