Secret Code 10

{% trans 'Sorry, your browser does not support canvas -- please either update your browser or submit your requirements by phone or email.' %}

Accelerometer

Avatar for Purparus Purparus

This is a improved version from the Secret Code I've shared previously. Now the secret code is a combination of a 5 digits from 0-9 each without repetition. Purpose of the game: The player(s) must guess the secret code. The winner is the one having the least number of tries. Operation The Button A is used to provide the number is each position. For each touch on the button, the value increases by 1, starting from 0 to 9 (cyclic). The number is shown as its binary representation on the current column (top down) Button B is used to move to the next column when the new value will be informed. Once passing the last column, the program will check the given combination against the secret code. The result is presented on the bottom line based on the following pattern: - Blinking led: Existing number on the right position - Steady lead: Existing number but wrong position The sequence of the leds on the pattern are not linked to the position of the numbers. Example: Secret Code: 10954 Input code: 52314 Result pattern: 1 blinking led (number 4) 2 steady leds (numbers 1 &,5) Interpretation: 3 numbers correct (1,4 & 5) where one is in the right position. When the input matches 100% the secret code, the game ends showing the number of tries. You can make it more difficult removing the logic to prevent the uniqueness of the numbers composing the code. Have fun!

Report this project
Back to top