(fwd) self-printing program

new topic     » topic index » view thread      » older message » newer message

Any Euphoria solution for this one?

>Date: Sun, 19 Apr 1998 00:08:49 -0400 (Eastern Daylight Time)
>From: Brendan Connell <bconnell at mbhs.edu>
>To: hs-computing at delos.com
>Subject: self-printing program
>
>This doesn't really seem like an olympiad-style problem, but it's an
>interesting programming challenge anyway...
>
>The basic problem is simple:  Write a completely self-contained program
>that prints out its own source code.
>
>A couple guidelines:
>  * You can use practically any modern programming language--C, Pascal,
>    Perl, etc.
>  * Your program should be as short as possible.
>  * By "self-contained", I mean the program shouldn't access any
>    external storage.  (This also means that once compiled, the program
>    should work even if the original source code is discarded.)
>
>It should quickly become obvious that (in most languages, at least) a
>one-line program consisting of a single "print" statement won't do the
>trick.
>
>I'll post my own solution if anyone wants to see it.
>
>-Brendan
>
>         (__)     ___                 _               bconnell at mbhs.edu
>         (oo)    | _ )_ _ ___ _ _  __| |__ _ _ _      connell at mnsinc.com
>  /-------\/     | _ \ '_/ -_) ' \/ _` / _` | ' \
> / |     ||      |___/_| \___|_||_\__,_\__,_|_||_|    Montgomery Blair HS
>*  ||----||        http://www.mbhs.edu/~bconnell         Class of '98
>   ^^    ^^

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu