I am a bit confused.
You check the entered code in two places. When the “Ok” button is pressed, and in the “update_display” function.
Isn’t the one in update_display() function unnecessary? After all, from what i understood, the “Ok” button is there to tell the game that we want to check the entered code. With the check in update_display, it will automatically fire when the entered code is correct.
Or did you intend it the other way around?