Secret Code

{% 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

Your objective is to find the "secret code" generated by the program. It is composed by the binary representation of an integer between 0 and 31 The game ends when the corresponding set of leds is provided. Commands: a blinking led shows the current column position. Button "A" switches the led status on/off. To facilitate a distinct tone tells you the current status (high pitch -> on, low pitch -> off) Button "B" moves the cursor to the right. Once the cursor passes the last column, it checks the given code. There is no way back. Example: Imagine the program generated the number 5 what is represented binary by the sequence 10100. So, to win the game you have to switch on the leds on columns 0 and 2 from the panel. Reproducing the movements we would have: Button A to start Button A Led 0 -> On Button B Led 1 -> Off Button B Led 2 -> Off Button A Led 2 -> On Button B Led 3 -> Off Button B Led 4 -> Off Button B Code checked Result on the panel 10100 I intend to extend this program to generate codes with 5 digits each varying from 0 to 9. So each position (column) will represent the input as binary using the first four leds downwards example: Button A pressed 5 times representing the selection of the number 5. The panel will show (from top down) 1 (led ON) 0 (led OFF) 1. (led ON) 0 (led OFF) The result will always be presented on the last row with a distinct representation: n Blinking leds: n Numbers in the right position m Steady leds: m Numbers correct but in wrong position This will increase the challenge. Feel free to extend my code and add above logic anyway. have fun!

Report this project
Back to top