หากไม่รวมโปรแกรมเล็ก ๆ น้อย ๆ รหัสใดที่รวบรวมในจำนวนภาษามากที่สุด
(โดย "เล็กน้อย" ฉันหมายถึงการยกเว้นคำตอบเช่นโปรแกรมว่างหรือข้อความที่จะถูกสะท้อนโดยตรง)
รหัสต่อไปนี้เห็นได้ชัดว่ารวบรวมในภาษาการเขียนโปรแกรมต่อไปนี้ทั้งหมด (และพิมพ์สิ่งที่แตกต่างกันในแต่ละภาษา): C, C ++, Perl, TeX, LaTeX, PostScript, sh, bash, zsh และ Prolog
%:/*:if 0;"true" +s ||true<</;#|+q|*/include<stdio.h>/*\_/
{\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%*/
นั่นคือ 10 ภาษาที่แตกต่างกัน ฉันพบมันผ่านpts oldalai (ที่ยังมีบทกวีคริสต์มาสที่งดงามที่เขียนใน C, C ++, Perl และ TeX) ใคร ๆ ก็ทำได้ดีกว่ากัน?
                
                8
              
                  ศัพท์เทคนิคคือPolyglot
                
                
                  
                    —
                    st0le 
                    
                  
                
              
                  ที่นี่พูดได้หลาย
                
                
                  
                    —
                    st0le 
                    
                  
                
              
                  หาก sh, bash และ zsh นับเป็นภาษาที่แตกต่างกันแม้ว่าจะเป็นเพียงการใช้ sh แล้วฉันคิดว่าคุณต้องระบุสิ่งที่คุณนับว่าเป็นภาษาต่างๆอย่างแม่นยำ เช่น Perl 4 กับ Perl 5.10 มีความแตกต่างที่สำคัญ
                
                
                  
                    —
                    Peter Taylor 
                    
                  
                
              
                  มีหลายภาษา (เช่น Whitespace, BrainF ** k และ Perl) ซึ่งการรวมตัวอักขระใด ๆ เป็นโปรแกรมที่ถูกต้อง พวกเขาสามารถอ้างสิทธิ์โดยโปรแกรมใด ๆ
                
                
                  
                    —
                    ugoren