Master.c

/* This program gives you the numbers to use to crack a Master Combination padlock
   in less than 5 minutes. This is my first C program. So don't mention anything
   about how poorly it is written. 

   First off you need the "odd" number, which is not necessarily an odd number, but
   it's odd compared to the others.  Ehh.  Just do this:

   Set the dial to 0.
   Pull up on the lock and try to turn the dial.  It doesn't move much does it?
   Move around the dial while you pull up on the lock and record the numbers that the
   pointer touches when it only touches ONE number. If you pull up on the lock part, and
   you turn the dial and it touches two numbers, don't bother writing those numbers down. 

   Now you should get a set of numbers that, when you pulled up on the lock part, the dial
   touched only one number.   There should be 5-6 of these numbers.  Write them down.  You
   will see one that doesn't look right. Ex: 5,15,17,25,35.  

   Simply enter than number into my program here and you will be left with 64 possible
   combinations.  Try em until you crack it.  Don't bitch about it being 64 combinations
   because before this program you had 64,000.  You're welcome. 

   Shout outz to Rog, Chizz, Em, Pro, and my boy Zeb.
*/

#include <stdio.h>

int oddnm = 0;
int remainder = 0;
int remainder2 = 0;
int x = 0;

int main ()
{
	printf("Enter the odd number you've collected: ");
	scanf("%d", &oddnm);

	x = oddnm;

	if (oddnm < 0 || oddnm > 40)
	{
		printf("\nNot a valid number, try again!\n");
		return 0;
	}
// All good up to here.
	remainder = oddnm % 4;			// Odd number mod 4
	remainder2 = remainder;			

	if (oddnm < 5)				//mod 4 doesn't work with low nums??
	{
		remainder = 0;
		remainder2 = 2;
	}

	if (oddnm > 4)
	{
		remainder2 = remainder + 2;
	}

	//printf("\nRemainder = %d\n\n", remainder);
	printf("\n1st num possibilities are: ");

	while (remainder <= 39)
	{
		printf("%d  ",remainder);
		remainder = remainder + 4;
	}
	printf("\n2nd num possibilities are: ");
	//This is our problem area.
	//Finding out how to get the numbers right on all remainders...
	//Probably easy, but it's tricky for me. 

	if(remainder2 == 5)			// AHH  the solution
	{
		remainder2 = remainder2 - 4;
	}

	while (remainder2 <= 40)
	{
		printf("%d  ",remainder2);
		remainder2 = remainder2 + 4;
	}
	printf("\n3rd num is always        : %d", x);
	printf("\n\n");
	return 0;
}

Leave a Reply

Spam protection by WP Captcha-Free