Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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 */

Replies are listed 'Best First'.
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!

    "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?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://204451]
Approved by JaWi
Front-paged by beretboy
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2017-06-27 07:16 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (600 votes). Check out past polls.