10 languages
Anonymous Monk
created: 2006-01-15 19:34:50
Continuing the good traditions set by truedfx, I've written just another program.
%:/*:if 0;"true" +s ||true</*\_/
{\if(%)}newpath/Times-Roman findfont 20 scalefont setfont(
%%)pop 72 72 moveto(Just another PostScript hacker,)show((
t)}. t:-write('Just another Prolog hacker,'),nl,halt. :-t.
:-initialization(t). end_of_file. %)pop pop showpage(-: */
int main(){return 0&printf("Just another C%s hacker,\n",1%
sizeof'2'*2+"++");}/*\fi}\csname @gobble\endcsname{\egroup
\let\LaTeX\TeX\ifx}\if00\documentclass{article}\begin{doc%
ument}\fi Just another \LaTeX\ hacker,\end{document}|if 0;
/(J.*)\$sh(.*)"/,print"$1Perl$2$/"if$_.=q # hack the lang!
/
sh=sh;test $BASH_VERSION &&sh=bash;test $POSIXLY_CORRECT&&
sh=sh;test  $ZSH_VERSION && sh=zsh;awk 'BEGIN{x="%c[A%c[K"
printf(x,27,27)}';echo "Just another $sh hacker," #)pop%*/

Please forgive that it is not as hard to understand as it should be -- but believe me it was hard enough to write it, since this is my first obfuscation attempt in all the ten programming languages I know.

Next week I will be learning 10 more languages. I hope I can keep this learning rate throughout the year, and in December I can write my Christmas carol in any language, and nobody will understand it.

Re: 10 languages
created: 2006-01-16 03:33:54
well, since you're here, the list has to include perl.

so here's what i can see:

  • c
  • ...

you know what, i give up. i assume there's c++ (assuming you're counting it separate from c), perl, and bash. given some of the strings in there, i'd assume tex. you mention prolog, but i'm completely unfamiliar with that. is that pdf in there? postscript, i guess. don't tell me you're counting different shells (bash,zsh) as different languages...

i just don't have the energy to parse this.

had i any votes left, you'd get 'em.

Re^2: 10 languages
created: 2006-01-16 11:47:32
C, C++, Perl, Prolog, sh, bash, zsh, TeX, LaTeX and PostScript makes for ten different outputs, but even if you don't want to count them all as separate languages, that's still a very impressive six.
Re: 10 languages
created: 2006-01-16 11:45:28
Nice, I'm surprised there was more to add without breaking the rest. I've been looking at Lisp myself, but unfortunately there doesn't seem to be a way to add that without making either the C or the Lisp code invalid, or removing some other language. (C, Lisp, Perl, and maybe sh and TeX is doable though. The big problem is PostScript.)
Re^2: 10 languages
created: 2006-01-17 12:42:38
If you open a paren in PostScript, it just starts a string, which you can cancel later with `pop'. And a paren is a quite harmless character in most other languages. See the 1st two lines in my original code.
Re^3: 10 languages
created: 2006-01-17 14:36:40
Thanks. Unfortunately, the problem is that a C program (again, unless you don't mind making it invalid) can't start with a (; it must start with a keyword after preprocessing, and before preprocessing, the only ways around that are by starting with #, %:, //, /*, or _Pragma, possibly combined with \. (Technically, trigraphs could also be used, but ?? causes even bigger problems.) Comments in Lisp start with ; or are embedded in #|...|#, so the opening must be a valid Lisp expression. The two things that don't break C that I could find are //, and #\ followed by a newline. Both seem to unconditionally break PostScript, but if you have a way around that, I'd be very interested.
Re: 10 languages
created: 2006-01-18 11:17:51

Me arrodillo ante tu maestría! Olé Olé y Olé!!!

turo@indus:/tmp$ latex idle.tex
Output written on idle.dvi (1 page, 320 bytes).
Transcript written on idle.log.
turo@indus:/tmp$ xdvi idle.
...
10 languages?
turo@indus:/tmp$ perl idle.tex 
Just another Perl hacker,

(this one was expected ...) ...
turo@indus:/tmp$ sh idle.tex 
Just another sh hacker,
...
turo@indus:/tmp$ gcc -o idle idle.c   
turo@indus:/tmp$ ./idle
Just another C hacker,

Really impressed!!! ... Men you are my Idol ... and there are 6 hidden langs ... You are my Hero!!! Yeahha!!!

perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

perlmonks.org content © perlmonks.org and Anonymous Monk, chargrill, truedfx, turo

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03