Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Holy shit

Name: Anonymous 2010-05-29 21:08

I have just discovered the most EXPERT PROGRAMMER ever. This is like nothing I have ever before laid my eyes on, it is mindblowing. I only hope that some day I may be able to write code of this quality.

http://code.activestate.com/recipes/576616-factorial-lambda/

Name: Anonymous 2011-07-21 14:40

>>35
Here ya go!

int main(){int j;int i=0;int total=1;char c;while((c=getch()),c>='0' && c<='9'){printf("%c",c);i=(i*10)+(c-'0');}for(i;i>0;i--){total*=i;}printf("\n%d",total);getch();}

Name: Anonymous 2011-07-21 14:43

>>41
getch
Die in a fire.

Name: Anonymous 2011-07-21 14:44

>>41
disgusting

Name: Anonymous 2011-07-21 14:44

>>42
umadbro?

Name: Anonymous 2011-07-21 14:44

>>39
Go back to /g/ please

Name: Anonymous 2011-07-21 14:46

>>42
>>43
What's the big deal? So it ends with it just because-

Oh, it's in the loop too. -,-

Name: Anonymous 2011-07-21 14:46

>>40
Nice. What language is this??

Name: Anonymous 2011-07-21 14:49

>>47
It's just pure C.

Name: Anonymous 2011-07-21 14:52

>>48
lol wut?

Name: Anonymous 2011-07-21 14:53

>>49
As opposed to C++

Name: Brian Kernigan 2011-07-21 14:55

sub fact($n){return ($n == 0) ?? 1 !! [*] 1..$n;}; say fact(10)
Yeah, it's C

Name: Anonymous 2011-07-21 15:03

>>51
What's yours?

Name: Brian Kernigan 2011-07-21 15:11

say [*](1..(prompt "Enter a positive integer, you fag:"))

Name: Anonymous 2011-07-21 16:33

>>40,51,53
So... what language is that?

Name: Anonymous 2011-07-21 16:45

>>54
in case of doubt: perl

Name: Anonymous 2011-07-21 16:53

DO YOU WANT A BEARD?
DO YOU WANT A SHARIA?

Name: Anonymous 2011-07-21 17:59

>>27
Well, if it really is a substitution cypher (I refuse to have my eyes raped by reading his actual code), then whatever he has encoded there is not English.

If you assume that the most common character is a space, it decrypts to something like this:
x x xx x xxx xx xxx xxx xxxxxxxx x xxxx xx xxxxx xxxxxxxxxxxx xx x xxxx xx xxx xx x x xxx xx x x x xxxxxxxx xxxx xxxx xx x xx xxxx x xxxxx xxx xxx xxxxxxxx xxxx xxx x

That's not English because English sentences don't contain primarily single-letter words.  I guess it could be some retarded text-speak, like "u r gay & i am cool," though.

If you assume that the space is the second most common character, you get this:
xxxxxxxxxxxxxxxxxxxxx xxxx xxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxx xxxxxxxxxxxxxxxx xxxxx xxxx xxxx xxxxxxxxxxxxx x xxxxxxxxxxxx xxxxxxxx xxxxxxxx

And English sentences don't usually contain such a high frequency of such long words.  Further, not one single character is ever repeated in any word.  You just don't write much English without running into LL or SS or EE, for example.

Name: Anonymous 2011-07-21 18:06

>>57
u just mad coz u r gay & i am cool

Name: Anonymous 2011-07-21 18:13

>>58
u right i so mad

Here is some really simple sepples for trying to decode it.  It's not going to decode to anything, though, because Fouad has trolled us all mightily especially me, apparently.


#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

// Usage:
//
//    decode "decode string"
//
// Where "decode string" is a quoted string that contains at least as many characters
//  as are present in cipher_text, with the most common letter first.
//
// Example (using letter frequencies from English):
//
//    decode " etaoinshrdlcumwfgypbvkjxqz????"
//
// Output:
//
// t a ?i t tly jt dq? ?ed vmeapteo n newf ur mncis gtscincihxbf zs m tkde sl aeo yo r
// h ner gr ? b t raizoeko anel aset ly j qo aniv a eoewo sci uas hehigpns dewf uhx o

// Text to decode, terminate with -1
int cipher_text[] =
{
  9591, 278055, 268467, 278055, 354759, 28767, 278055, 9591, 278055, 9591,
  143823 , 383523, 278055, 134235, 9591, 278055, 124647, 249291, 47943,
  278055, 115059, 373935, 124647, 278055, 76707, 182175, 373935, 268467,
  19179, 9591, 373935, 325995, 278055, 38355, 278055, 38355, 373935, 230115,
  258879, 278055, 162999, 220527, 278055, 182175, 38355, 316407, 28767, 239703,
  278055, 306819, 9591, 239703, 316407, 28767, 38355, 316407, 28767, 57531,
  201351, 67119, 258879, 278055, 364347, 239703, 278055, 182175, 278055, 9591,
  95883, 124647, 373935, 278055, 239703, 143823, 278055, 268467, 373935, 325995,
  278055, 383523, 325995, 278055, 220527, 278055, 57531, 278055, 38355, 373935,
  220527, 278055, 306819, 220527, 278055, 297231, 278055, 67119, 278055, 9591,
  278055, 220527, 268467, 28767, 364347, 325995, 373935, 95883, 325995, 278055,
  268467, 38355, 373935, 143823, 278055, 268467, 239703, 373935, 9591, 278055,
  143823, 383523, 278055, 134235, 278055, 249291, 325995, 278055, 268467, 38355,
  28767, 76707, 278055, 268467, 278055, 373935, 325995, 373935, 230115, 325995,
  278055, 239703, 316407, 28767, 278055, 162999, 268467, 239703, 278055, 57531,
  373935, 57531, 28767, 306819, 19179, 38355, 239703, 278055 , 124647, 373935,
  230115, 258879, 278055, 162999, 57531, 201351, 278055, 325995, -1
};

map<int, int> freq;

bool sort_func(int a, int b)
{
    return freq[a] > freq[b];
}

int main(int argc, char **argv)
{
    if (argc != 2)
    {
        cout << "No decode string" << endl;
        return 1;
    }

    string letters_by_frequency = argv[1];

    for (size_t i = 0; cipher_text[i] != -1; i++)
    {
        if (freq.find(cipher_text[i]) != freq.end())
        {
            freq[cipher_text[i]]++;
        }
        else
        {
            freq[cipher_text[i]] = 1;
        }
    }

    if (letters_by_frequency.size() < freq.size())
    {
        cout << "Decode string must contain at least " << freq.size() << " characters" << endl;
        return 1;
    }

    vector<int> cipher_sorted;

    for (map<int, int>::iterator iter = freq.begin(); iter != freq.end(); iter++)
    {
        cout << iter->first << ": " << iter->second << endl;

        cipher_sorted.push_back(iter->first);
    }

    cout << endl;

    sort(cipher_sorted.begin(), cipher_sorted.end(), sort_func);

    map<int, char> decode;

    for (size_t i = 0; i < cipher_sorted.size(); i++)
    {
        decode[cipher_sorted[i]] = letters_by_frequency[i];

        cout << cipher_sorted[i] << ": " << letters_by_frequency[i] << endl;
    }

    for (size_t i = 0; cipher_text[i] != -1; i++)
    {
        cout << decode[cipher_text[i]];
    }

    cout << endl;

    return 0;
}

Name: Anonymous 2011-07-21 18:17

# select a random number from 1 to infinity
wut

Name: Anonymous 2011-07-21 18:23

>>60
holy shit if you put you're mouse on the quote line a faint yellow highlight appears

Name: Anonymous 2011-07-21 18:26

|OOOOO|
|OOOOO|
|OOOOO|
|OOOOO|
|OOOOO|

Name: Anonymous 2011-07-21 18:29

>>62
old shit is old. I just somehow never noticed the yellow thing

Name: Anonymous 2011-07-21 18:36

>>63
| old shit is old. I just somehow never noticed the yellow thing
That's how we tell the newbies that can't quote from the true experts.

Name: Anonymous 2011-07-21 18:40

>>64
| |

Name: Anonymous 2011-07-21 18:41

>>65
| < Proper quote

Name: Anonymous 2011-07-21 20:09

>>64
yellow thing
that's not there, that's just in your head

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List