Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

CONTEST - Paragraph Print

Name: Anonymous 2010-01-19 1:00

Write the smallest possible program that can print the following paragraph (sans quotes):

"Educators, generals, dieticians, psychologists, and parents program. Armies, students, and some societies are programmed. An assault on large problems employs a succession of programs, most of which spring into existence en route. These programs are rife with issues that appear to be particular to the problem at hand. To appreciate programming as an intellectual activity in its own right you must turn to computer programming; you must read and write computer programs -- many of them. It doesn't matter much what the programs are about or what applications they serve. What does matter is how well they perform and how smoothly they fit with other programs in the creation of still greater programs. The programmer must seek both perfection of part and adequacy of collection. In this book the use of ``program'' is focused on the creation, execution, and study of programs written in a dialect of Lisp for execution on a digital computer. Using Lisp we restrict or limit not what we may program, but only the notation for our program descriptions."

The quote must be printed in verbatim. Any language may be used. Programs are rated on the size of their compiled executable form, not the lines of code. Record holder has to draw an ASCII medal for whoever surpasses him.

The following is my entry. It's uncompressed, unoptimized C code, and it compiles to 18475 bytes using the standard GCC settings on Win32. I hope that it will be surpassed shortly.

#include <stdio.h>

int main (void)
{
    printf("Educators, generals, dieticians, psychologists, and parents program. Armies, students, and some societies are programmed. An assault on large problems employs a succession of programs, most of which spring into existence en route. These programs are rife with issues that appear to be particular to the problem at hand. To appreciate programming as an intellectual activity in its own right you must turn to computer programming; you must read and write computer programs -- many of them. It doesn't matter much what the programs are about or what applications they serve. What does matter is how well they perform and how smoothly they fit with other programs in the creation of still greater programs. The programmer must seek both perfection of part and adequacy of collection. In this book the use of ``program'' is focused on the creation, execution, and study of programs written in a dialect of Lisp for execution on a digital computer. Using Lisp we restrict or limit not what we may program, but only the notation for our program descriptions.");
    return 0;
}


Your move, /prog/.

Name: Anonymous 2010-01-19 12:46

Challenge isn't very exact.
If you allow interpreted languages, than it's enough to just quote the text and have it printed(many languages will work here) by the REPL or to standard output.
If you only allow compiled native code, then the assembly language used counts, the container for the executable format counts and of course the compiler counts. ELF and PE executable file formats can be shrinked significantly, but there's still a mandatory header, so they won't be the smallest. COM(raw MSDOS code) or something which is executed at boot load time would be smaller as it's just raw code, so it should be fairly tiny: the size of the text + the few instructions to pass some parameters and the interrupt to actually display the text. Which means that unless OP imposes some restrictions, the tinyest program can only be obtained by using raw machine code for some platform like x86 16bit. More size can be shaved off if you use a compact compression algorithm. Sadly, Lisp or Haskell cannot win this challenge because of how it was worded without coding a compiler which compiles this stripped down code (use an inline assembler like Movitz to generate the assembly code).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List