First, a 4-digit code is generated. Then you try to guess it in as few attempts as you can. Type your guess on the keypad, then press enter. Use the arrows to scroll through your attempts, since only nine attempts will fit on the screen. If you're on a computer, go on this project: https://scratch.mit.edu/projects/1161923564/ If a number stays white, it's not used in the code. If it turns red, it's in the code, but not in the correct place. If the number turns green, it's correct and in the right place. You only have 10 attempts to guess the code.
I made this project mobile friendly in 2 days. I also figured out how to make a text engine by myself.