I wrote something for you.
1
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.
2
Name:
Anonymous
2007-04-23 15:14
ID:nDvoJ6Xf
I lol'd so hard
3
Name:
Anonymous
2007-04-23 15:18
ID:NLrt5Mm3
it prints "QUACK, MOTHER FUCKER!"
WARNING SPOILER ABOVE
4
Name:
Anonymous
2007-04-23 16:02
ID:qozDmb4u
what
5
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.
6
Name:
Anonymous
2007-04-23 16:34
ID:ZmGaf/11
>>5
Left, right, return right. Fail you.
7
Name:
Anonymous
2007-04-23 16:43
ID:wIiwP2bQ
>>1
Win
>>5
Falsehood, go learn C.
>>6
Truth.
8
Name:
Anonymous
2007-04-23 22:49
ID:KCmNr+LO
>>1 =
>>1, >>5, >>6 and
>>7 .
It is you who phails. Ha!
9
Name:
Anonymous
2007-04-23 23:14
ID:qqJh/wtq
>>8
Falsehood, look at the IDs.
10
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.
11
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
12
Name:
Anonymous
2007-04-24 7:27
ID:gkSdJWvQ
13
Name:
Anonymous
2007-04-24 11:11
ID:r3cXfjLy
>>12
Falsehood it's turing you dipshit
14
Name:
Anonymous
2007-04-24 12:04
ID:K72QfmtT
>>13
Falsehood, stop trolling
15
Name:
Anonymous
2007-04-24 17:54
ID:dvtYs0Yt
Shut up, all of you
16
Name:
Anonymous
2007-04-24 17:55
ID:dvtYs0Yt
17
Name:
Anonymous
2007-04-24 18:15
ID:PfI9lbxp
>>1
Did you intend on misspelling Turing complete?
18
Name:
Anonymous
2007-04-24 18:18
ID:YFkItQp/
19
Name:
Anonymous
2007-04-24 18:50
ID:tP77rTcs
>>16
Awesome, my touring-complete ducks in the Usenet?
20
Name:
Anonymous
2007-04-24 18:57
ID:r3cXfjLy
>>18 is OP
FUCKING FAGS.
it's not even obfuscated.
jesus fucking christ.
21
Name:
Anonymous
2007-04-24 19:53
ID:dvtYs0Yt
22
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.
23
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.
24
Name:
Anonymous
2007-04-25 8:22
ID:LOGznJgD
>>23
10 years of writing C FOR BABIES MORE LIKE LPLOLOLOL
25
Name:
Anonymous
2007-08-02 6:47
ID:v0VhmrKR
Bump for sexual deviance
26
Name:
Anonymous
2007-08-02 7:07
ID:Heaven
27
Name:
Anonymous
2007-08-02 7:21
ID:Heaven
28
Name:
Anonymous
2007-08-02 7:34
ID:Heaven
sage for piss
29
Name:
Anonymous
2007-08-02 10:00
ID:Heaven
>>26
Holy shit, that's like ancient.
30
Name:
Anonymous
2009-01-14 13:28
IHBT
31
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.
32
Name:
Anonymous
2009-11-29 2:20
This thread is the only thing in the world that can get me off :(
33
Name:
Anonymous
2009-11-29 4:27
I don't understand OP's code. Is this bad? Should I actually learn C?
34
Name:
Anonymous
2009-11-29 5:25
Is this the first use of Touring complete on /prog/ ? Am I watching history here?
35
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.
36
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.
37
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;
}
38
Name:
Anonymous
2009-11-29 5:41
>>36
Exactly. Like Haskell.
39
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
40
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