Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "Lock.h"
- #include "Speaker.h"
- int main(void) {
- int lock = LOCK_GenerateLock(); /* generate a new lock of type 'unsigned int' (32bit) */
- int correctBits;
- int key = -1;
- for( unsigned int i = 0; i <= 99999U; ++i )
- {
- correctBits = LOCK_Test( i );
- if( correctBits == 32 )
- key = i;
- }
- //n = LOCK_Test(5); /* check number of correct bits */
- //SPEAKER_Play(1000,200); /* play 1000 Hz for 200 ms */
- if( key != -1 )
- printf( "Error couldn't find the key.\n" );
- else
- printf( "The correct key is %d\n", key );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement