Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
"be consistent"
 
PerlMonks  

Polyglot Japh

by Dedalus (Scribe)
on Oct 11, 2002 at 09:13 UTC ( #204451=obfuscated: print w/ replies, xml ) Need Help??

My first JAPH:
The following is legal, and produces output, in BASIC, Befunge, JavaScript (place between <SCRIPT> </SCRIPT> tags in an HTML file) and Perl.
'11';//;# 76+v,g4-\+0*55:<p0*73+5-*72p0*64*69p1*5 < '';//;# japh >:1- JAPH \#^_$$"egnufeB">:#,_7>88*:6^ '0'?eval("function print(japh){document.write(japh"+ ''+".replace(/Perl/,'JavaScript'))}",' '):$_=qq+0; eval("print('Just Another Perl Hacker.')"),";\x22+;" ''/*";$\=$/; eval ;__END__ SUB eval (ja$,ph$) PRINT MID$(ja$, 8, 13); "BASIC"; MID$(ja$, 25, 8) END SUB ' Dedalus */

Comment on Polyglot Japh
Download Code
Re: Polyglot Japh
by sauoq (Abbot) on Oct 11, 2002 at 22:00 UTC

    This really is quite nice. It worked without problems as Befunge, JavaScript, and Perl. Unfortunately, I can't get it to work as BASIC. It gives me an error with bas-1.0 and core dumps with bwbasic. Can anyone point me at a freely available BASIC interpreter for unix that won't barf on this?

    Great job!

    -sauoq
    "My two cents aren't worth a dime.";
    
      Um... oops. I tested the basic part in QB I'm afraid. As far as I can tell it should be legal basic code. It could be that the comment on the last line gives some trouble. You might try changing the last line to read:
      END SUB '*/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://204451]
Approved by JaWi
Front-paged by beretboy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-04-19 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls