| Author |
Message |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
Posted: Mon Feb 02, 2004 11:14 am Post subject: Crack the Code |
|
|
Ok, here is the puzzle.
Assume that you have the following phrase: 312125
And the code is: A=1, B=2, C=3, etc.
AND! 121 could be:
1 2 1 - A B A 12 1 - L A 1 21 - A U
What word (an English word btw) is that?
AND! What other possible words fit that phrase. Remember, this is February, so the phrase may have something to do with that. Eric D. Burdo - RLI Solutions
Sign Up Today for the Programmer's Corner Newsletter the drop ship guide - The complete guide on to how to get started with wholesale drop shipping. |
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 5:36 am Post subject: Re: Crack the Code |
|
|
trying by hand the second try i did gave me : clay The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
bdi Nobody
Joined: 21 Oct 2004 Posts: 1646 Location: Chicago
|
Posted: Tue Feb 03, 2004 7:50 am Post subject: Re: Crack the Code |
|
|
| What does clay have to do with february? (c(3)l(12)a(1)y(25)) Programmer's Corner - tutorials, articles, forums, and code for C++, SQL, .NET, java, and, web development Visual Basic Explorer - support forums and source code for all your Visual Basic 6 needs! the drop ship guide - The complete guide on how to get started with wholesale drop shipping.
|
|
| Back to top |
|
 |
bdi Nobody
Joined: 21 Oct 2004 Posts: 1646 Location: Chicago
|
Posted: Tue Feb 03, 2004 7:51 am Post subject: Re: Crack the Code |
|
|
| or Cable? Programmer's Corner - tutorials, articles, forums, and code for C++, SQL, .NET, java, and, web development Visual Basic Explorer - support forums and source code for all your Visual Basic 6 needs! the drop ship guide - The complete guide on how to get started with wholesale drop shipping.
|
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 8:07 am Post subject: Re: Crack the Code |
|
|
was a bit bored .. so did this in notepad :
======================
312125
======================
C - 12125 C - A - 2125 C - A - B - 125 C - A - B - A - 25 C - A - B - A - B - 5 C - A - B - A - B - E
======================
C - A - B - A - 25 C - A - B - A - Y
======================
C - A - B - 125 C - A - B - L - 5 C - A - B - L - E
======================
C - A - 2125 C - A - U - 25 C - A - U - B - E
======================
C - A - U - 25 C - A - U - Y
======================
C - 12125 C - L - 125 C - L - A - 25 C - L - A - B - 5 C - L - A - B - E
======================
C - L - A - 25 C - L - A - Y
======================
C - L - 125 C - L - L - 5 C - L - L - E
======================
of which i only know : 'clay' and 'cable' The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 8:19 am Post subject: Re: Crack the Code |
|
|
hmm we could get more words if we take the '(x -1) mod 26 + 1' of the nrs .. for example 31 -> 5 -> E
then we can get 'ebay' :) The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
bdi Nobody
Joined: 21 Oct 2004 Posts: 1646 Location: Chicago
|
Posted: Tue Feb 03, 2004 8:37 am Post subject: Re: Crack the Code |
|
|
| That second post is a sign you were really bored! LOL Programmer's Corner - tutorials, articles, forums, and code for C++, SQL, .NET, java, and, web development Visual Basic Explorer - support forums and source code for all your Visual Basic 6 needs! the drop ship guide - The complete guide on how to get started with wholesale drop shipping.
|
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 8:39 am Post subject: Re: Crack the Code |
|
|
nah .. the real sign that i was (am) bored is that i started to create a vb program which would show all the possible words (assume we allow the 'mod') ..
i got stuck on the recursive part though .. have to think it through before i put it in code :) The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 8:45 am Post subject: Re: Crack the Code |
|
|
hey! you submitted the puzzle .. you should at least know what it has to do with february :) The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
|
| Back to top |
|
 |
Hrqls De Blonde Puffin
Joined: 22 Oct 2004 Posts: 558 Location: Alkmaar, The Netherlands
|
Posted: Tue Feb 03, 2004 8:53 am Post subject: Re: Crack the Code |
|
|
hmm .. 'may' or 'february' .. make up your mind :p
hmm ... to create 'may' we need an 'm' which is 13 .. or 39 .. or 65 .. or ... hmm ..
could it be that the numbers are in hex ? :evil The specialty of the house ? thats me (cheap as always)
Visual Basic Explorer - For all your Visual Basic 6 needs! Programmer's Corner - .NET, Web Development, SQL, C++, and more. |
|
| Back to top |
|
 |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
|
| Back to top |
|
 |
Qnarcus@ Ronin
Joined: 19 Feb 2004 Posts: 21
|
Posted: Wed Mar 03, 2004 11:26 pm Post subject: Re: Crack the Code |
|
|
:) !!! Man, this is really funny, let's open up the thread again!
|
|
| Back to top |
|
 |
Ankou Spam Mod
Joined: 22 Oct 2004 Posts: 1201 Location: Wisconsin
|
|
| Back to top |
|
 |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
|
| Back to top |
|
 |
Ankou Spam Mod
Joined: 22 Oct 2004 Posts: 1201 Location: Wisconsin
|
|
| Back to top |
|
 |
Eric Idea Hamster
Joined: 21 Oct 2004 Posts: 679 Location: Bangor, Maine
|
|
| Back to top |
|
 |
Shaldares Grasshopper
Joined: 04 Nov 2006 Posts: 19 Location: Everywhere in the Salt Lake Valley, Utah
|
Posted: Tue Oct 21, 2008 4:05 pm Post subject: |
|
|
Well, I got bored, so I decided to give this a try, and well, I'm pretty sure it's possible, it would just take a lot of coding, as you would have to calculate the converting down to integers to a lower power for the rest of the letters, and then go through and weed out all of the possibilities. I'm not sure if I'm even going to go that far yet lol. I've started on it and I should have enough code in here to calculate the first possible outcome, however my compiler is pissing me off (it doesn't like how I'm doing my public variables, and I've tried to reformat them several times) so I'm going to take a break from it for a while. This is what I have so far, to give anyone else who's bored some ideas. And I'm sorry, yes, my code looks horrible and I haven't taken the time to document it yet
Oh, a sidenote, this is coded in C++.
| Code: | #include <cstdlib>
#include <iostream>
using namespace std;
void decode(int);
int convert(int);
char breakdown(int);
char a;
char b;
char c;
char d;
char e;
char f;
int count;
int code;
int main(int argc, char *argv[])
{
cout << ("Please enter the numerical code(only integers up to 6 digits.)\n");
cin >> code;
if (code>999999)
{
cout << ("Invalid number. Terminating program.");
system("PAUSE");
return EXIT_SUCCESS;
}
else
{
if (code>99999)
{
count=6;
}
else
{
if (code>9999)
{
count=5;
}
}
else
{
if (code>999)
{
count=4;
}
}
else
{
if (code>99)
{
count=3;
}
}
else
{
if (code>9)
{
count=2;
}
else
{
if (code>0)
{
count=1;
}
}
else count=0;
cout << ("Possible Answers:\n");
decode(code);
cout << f << e << d << c << b <<a>0)
system("PAUSE");
return EXIT_SUCCESS;
}
void decode(int code)
{
int result;
double decoding;
if (count>0)
{
decode(code);
switch(code){
case 6:
result=decoding=convert(code);
a=breakdown(result);
break;
case 5:
result=decoding=convert(code);
b=breakdown(result);
break;
case 4:
result=decoding=convert(code);
c=breakdown(result);
break;
case 3:
result=decoding=convert(code);
d=breakdown(result);
break;
case 2:
result=decoding=convert(code);
e=breakdown(result);
break;
case 1:
result=decoding=convert(code);
f=breakdown(result);
break;
}
return
}
char breakdown(int result)
{
switch(result){
case 1:
temp="A";
count-=1;
code-=1;
break;
case 2:
temp="B";
count-=1;
code-=2;
break;
case 3:
temp="C";
count-=1;
code-=3;
break;
case 4:
temp="D";
count-=1;
code-=4;
break;
case 5:
temp="E";
count-=1;
code-=5;
break;
case 6:
temp="F";
count-=1;
code-=6;
break;
case 7:
temp="G";
count-=1;
code-=7;
break;
case 8:
temp="H";
count-=1;
code-=8;
break;
case 9:
temp="I";
count-=1;
code-=9;
break;
}
return temp;
}
int convert(int decode)
{
switch(count)
{
case 1:
if (decode<1)
{
decode*=10;
}
else
{
decode*=1;
}
break;
case 2:
if (decode<1)
{
decode*=10;
}
else
{
decode*=0.1;
}
break;
case 3:
if (decode<1)
{
decode*=10;
}
else
{
decode*=0.01;
}
break;
case 4:
if (decode<1)
{
decode*=10;
}
else
{
decode*=0.001;
}
break;
case 5:
if (decode<1)
{
decode*=10;
}
else
{
decode*=0.0001;
}
break;
case 6:
if (code<1)
{
decode*=10;
}
else
{
code*=0.00001;
}
break;
{
return decode;
}
|
|
|
| Back to top |
|
 |
|