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

I wrote something for you.

Name: Anonymous 2007-04-23 14:57 ID:qqJh/wtq


#include <stdio.h>
int main(int c,char**v) {
        char *s="B+p:ubYBGG0,|M3B=1*0N\n"
                "it's touring complete\n",*k[]={s+21,--s};
        return c?({while(main(!k,k))putchar(**k^*k[1]-10);0;}):(v[1]++,*++*v);
}


Build with GCC.

Name: Anonymous 2007-04-23 15:14 ID:nDvoJ6Xf

I lol'd so hard

Name: Anonymous 2007-04-23 15:18 ID:NLrt5Mm3

it prints "QUACK, MOTHER FUCKER!"


WARNING SPOILER ABOVE

Name: Anonymous 2007-04-23 16:02 ID:qozDmb4u

what

Name: Anonymous 2007-04-23 16:28 ID:Gf5HioaV

>>1
Dangerous program since the standard does not specify what order the operator ',' will be evaluated in.

Name: Anonymous 2007-04-23 16:34 ID:ZmGaf/11

>>5
Left, right, return right. Fail you.

Name: Anonymous 2007-04-23 16:43 ID:wIiwP2bQ

>>1
Win

>>5
Falsehood, go learn C.

>>6
Truth.

Name: Anonymous 2007-04-23 22:49 ID:KCmNr+LO

>>1 = >>1, >>5, >>6 and >>7.

It is you who phails. Ha!

Name: Anonymous 2007-04-23 23:14 ID:qqJh/wtq

>>8

Falsehood, look at the IDs.

Name: Anonymous 2007-04-24 0:20 ID:JgBlArE5

>>9
No one posts in that short of a time span, he just changed his IP between each post.

Name: Anonymous 2007-04-24 7:07 ID:K72QfmtT

>>8
Falsehood, I'm >>7 and I'm not ayone else in this thread but >>11

Name: Anonymous 2007-04-24 7:27 ID:gkSdJWvQ

Name: Anonymous 2007-04-24 11:11 ID:r3cXfjLy

>>12
Falsehood it's turing you dipshit

Name: Anonymous 2007-04-24 12:04 ID:K72QfmtT

>>13
Falsehood, stop trolling

Name: Anonymous 2007-04-24 17:54 ID:dvtYs0Yt

Shut up, all of you

Name: Anonymous 2007-04-24 17:55 ID:dvtYs0Yt

Name: Anonymous 2007-04-24 18:15 ID:PfI9lbxp

>>1
Did you intend on misspelling Turing complete?

Name: Anonymous 2007-04-24 18:18 ID:YFkItQp/

Name: Anonymous 2007-04-24 18:50 ID:tP77rTcs

>>16
Awesome, my touring-complete ducks in the Usenet?

Name: Anonymous 2007-04-24 18:57 ID:r3cXfjLy

>>18 is OP

FUCKING FAGS.
it's not even obfuscated.
jesus fucking christ.

Name: Anonymous 2007-04-24 19:53 ID:dvtYs0Yt

Name: Anonymous 2007-04-25 0:56 ID:XbHE7GFv

#include <stdio.h>
int main(int c,char**v) {
    char *s="B+p:ubYBGG0,|M3B=1*0N\nit's touring complete\n",
         *k[] = {s+21, --s};

    if (c) {
        while (main(!k, k))
            putchar(**k^*k[1]-10);
    } else {
        return (v[1]++,*++*v);
    }
   
    return 0;
}

Compiles in Visual Studio.

Name: Anonymous 2007-04-25 7:38 ID:/6kffxnw

>>20
It's quite tricky. I have 10 years of experience with C and I'm not ashamed to say it's tricky code.

Name: Anonymous 2007-04-25 8:22 ID:LOGznJgD

>>23
10 years of writing C FOR BABIES MORE LIKE LPLOLOLOL

Name: Anonymous 2007-08-02 6:47 ID:v0VhmrKR

Bump for sexual deviance

Name: Anonymous 2007-08-02 7:07 ID:Heaven

Name: Anonymous 2007-08-02 7:21 ID:Heaven

>>18
sage for pico

Name: Anonymous 2007-08-02 7:34 ID:Heaven

sage for piss

Name: Anonymous 2007-08-02 10:00 ID:Heaven

>>26

Holy shit, that's like ancient.

Name: Anonymous 2009-01-14 13:28

IHBT

Name: Anonymous 2009-03-06 7:21

Nice versions of that   instruction so it   would be insane   to create them   again in a   concatenative language Forth.

Name: Anonymous 2009-11-29 2:20

This thread is the only thing in the world that can get me off :(

Name: Anonymous 2009-11-29 4:27

I don't understand OP's code. Is this bad? Should I actually learn C?

Name: Anonymous 2009-11-29 5:25

Is this the first use of Touring complete on /prog/? Am I watching history here?

Name: Anonymous 2009-11-29 5:35

>>33
I don't see how anyone can be considered a real programmer if they don't know C.

Name: Anonymous 2009-11-29 5:37

>>35
As long as a person uses a Turing-complete language to describe a computer program, that person is a programmer.

Name: Anonymous 2009-11-29 5:40

OP's code is valid, but it's nothing more than a simple exercise in source code obfucation. Code should be as readable as possible, unless there's reason not to do that. Here's a rewritten version of his code, that does roughly the same in a more idiomatic manner:

#include <stdio.h>
int main(int argc,char *argv[])
{
        char *s1="B+p:ubYBGG0,|M3B=1*0N",
             *s2="it's touring complete";
        int i, len = strlen(s1);
        for (i = 0; i < len ; i++)
          putchar((s1[i]-10)^s2[i]);
        return 0;
}

Name: Anonymous 2009-11-29 5:41

>>36
Exactly. Like Haskell.

Name: Anonymous 2009-11-29 5:46

In haskell youd justuse >>= and << liftM_ and . and some zipWith ($) cycle some dongs with _|_ and your done. thats haskells idea of touring complete

Name: >>37 2009-11-29 5:53

Surprisingly, for some things, the C version is easier to read than the Lisp one:

(loop
  for c1 across "B+p:ubYBGG0,|M3B=1*0N"
  for c2 across "it's touring complete"
  do (princ (code-char (logxor (- (char-code c1) 10) (char-code c2)))))

;;; or a more lispy
(defun dec-str (s1 s2)
  (map 'string #'(lambda (c1 c2)
           (code-char (logxor (- (char-code c1) 10)
                      (char-code c2))))
       s1 s2))

(princ (dec-str "B+p:ubYBGG0,|M3B=1*0N" "it's touring complete"))

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