The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Self-Printing Program

Last post 03-17-2008 10:18 AM by PSWorx. 57 replies.
Page 2 of 2 (58 items) < Previous 1 2
Sort Posts: Previous Next
  • 02-13-2008 4:32 PM In reply to

    Re: Self-Printing Program

    Spectre:
    Tcl actually, but I guess Expect would run it too.

    (They're basically the same thing, expect is just the tcl interpreter with a few more functions added)

  • 03-12-2008 7:46 PM In reply to

    Re: Self-Printing Program

    All one line:

    <?php $str = '<?php $str = \'X\'; echo substr_replace($str, addslashes($str), 14, 1); ?>'; echo substr_replace($str, addslashes($str), 14, 1); ?>

    Briefcase is Lord!
  • 03-13-2008 4:42 AM In reply to

    Re: Self-Printing Program

    <?
        echo htmlentities(file_get_contents(__FILE__));
    ?>


    Filed under:
  • 03-13-2008 5:52 AM In reply to

    • PJH
    • Top 25 Contributor
    • Joined on 02-14-2007
    • Posts 624

    Re: Self-Printing Program

    ZiggyFish:
    <?
        echo htmlentities(file_get_contents(__FILE__));
    ?>
    It might be self-printing, but that certainly ain't a quine, and wouldn't qualify as such.

    This is not a problem that requires infinite wisdom, Benj. This is a problem that requires enough neural organization to qualify as a vertebrate, apparently a stretch for some folks these days.
    - Cecil Adams.
  • 03-13-2008 6:26 AM In reply to

    Re: Self-Printing Program

    The OP never mentioned it had to be a quine (it looks like they have names for this (WTF)). 



  • 03-14-2008 6:19 PM In reply to

    Re: Self-Printing Program

    A BASIC quine without using LIST:

    1 READ D$,S$:PRINT S$:PRINT D$;SPC(1);D$;MKI$(8748);S$
    2 DATA 2 DATA,"1 READ D$,S$:PRINT S$:PRINT D$;SPC(1);D$;MKI$(8748);S$

    An mIRC quine:

    //var %q $(| echo //var % $+ q $!( $+ %q $+ ,0) %q,0) | echo //var % $+ q $!( $+ %q $+ ,0) %q

  • 03-17-2008 9:34 AM In reply to

    Re: Self-Printing Program

    heres my first attempt at a real quine.

    sql proc:

    create proc q as declare @d varchar(500) set @d = 'create proc q as declare @d varchar(500) set @d = xyx select replace(replace(@d,char(120),char(39)),char(121),@d)' select replace(replace(@d,char(120),char(39)),char(121),@d) 

    Filed under:
  • 03-17-2008 10:18 AM In reply to

    Re: Self-Printing Program

    fun with data uris:

    data:text/html,<script>alert(location)</script> 

Page 2 of 2 (58 items) < Previous 1 2
Powered by Community Server (Non-Commercial Edition), by Telligent Systems