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

Pages: 1-4041-

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 1:13

Disregard OP, he's just too high. Here's the real contest.

Programs are rated on the number of octets in their source; any language, no reading or other syscalls allowed other than writing.

OP's program is 1107 octets, text is 1052, so your program must be less than that.

I'll write something in perl soon.

Name: Anonymous 2010-01-19 1:29

This competition is bullshit.

Name: Anonymous 2010-01-19 1:52

LISP LISP LISP

Name: Anonymous 2010-01-19 2:12

I choose the GZIP programming language.

#! gzip -cd
‹ =ZUK ]S1’Û0 ü
:7wþ@ª)2“2™´GS°Ä9’Pðý> Ê>{Òxhb¹XìBߦƒIÓš¹r §)±¥˜BÅyÕ=.’eNjøêDkh\Mim2·PÎôµ•Ä(ªõÉ+L¥0~¢“±Ý_žð¨RP
=I¥Ú<ê—ÌE‰ËšeÇ#Ò#«&`äz'@‡"j~³-).¤kKu¦TMˆÿB*×ÈÄ•štã3ý\X?ÛZZº2mÉJª>m    Fa]94>Í…}PøÐóqa˧@>rÁŒ ÒnÙc>×Цº"Ι£õ)DKÉvÜR‚²A`š£]:•މ¬·êÍ¢”ÊÛ3å—¬q˜†É[Kèû?Zéõ•J¨»;ÝÈè»Ñ$¬õd(˜cK‡q›}›ìáM¸À6’v”1`NØdà.ñNÊí"®þöª³Þ)“Ò"mù ®Ü®Òʐê-"¶äý¨^“    àîY<ìqISÚ-xµÎÙož#ØÇVµÃe~§ 8G{x_Ä9”„‰ÿô‡;QF<€À#ï‹."ïCAÇÒ óövkq:ùˆW‰(L¾¶Ï2_°yûq >‡ýykGZXM0à+ ÞÙ<?’® m'wÈœ ‹sÏ÷L¿Ôwkà7ì0«µGT9ØYÅŽÐP-a¿·~¡‹Zçu8ë=¥JkliQŸÿ<ì› 

Name: Anonymous 2010-01-19 2:13

(PS. I am not entirely sure what encoding my text editor read that file as.)

Name: Anonymous 2010-01-19 2:26

I preferred the Sussmen.

Name: Anonymous 2010-01-19 2:27

>>5
implying gzip supports shell-style comments

Name: Anonymous 2010-01-19 3:06

lp[w^http://dis.4chan.org/read/prog/1263880828/1-40^;c367..612]

Name: Anonymous 2010-01-19 3:19

Let's invite FV in here, his infinite compression could help!

Name: Anonymous 2010-01-19 4:47

>>10
oh god, the first time a joke in /prog/ was actually funny.

Name: Anonymous 2010-01-19 6:41

>>1
Programs are rated on the size of their compiled executable form

compiled

you fuck you OP !
this doesnt say a crap .

#!/usr/bin/perl
print "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.";

print "fuck you and your compiled crap.";

yeah thats right i didnt use code tags so sue me.

Name: Anonymous 2010-01-19 7:50

Fuck you and your compiled code.

Here's APL to rock your balls.

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

Name: Anonymous 2010-01-19 8:01

>>12
u mad

Name: Anonymous 2010-01-19 8:06

>>13
Quick, codegolf a random shuffle!

Name: Anonymous 2010-01-19 8:53

>>1
Am I allowed to use dynamic linking against common libraries?

Name: Anonymous 2010-01-19 8:54

>>16
>>15
va' fa Napoli

Name: Anonymous 2010-01-19 10:36

import java.io.*;
public class TheQuote
{
    public static void main(String[] args)
    {
        System.out.println("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.");
    }
}


Probably the least retarded Java I've ever had to write.  Compiles to 1,462 bytes.

Name: Anonymous 2010-01-19 10:50

96 characters using the power of the UNIX™ PROGRAMMING ENVIRONMENT.

curl -s http://dis.4chan.org/read/prog/1263880828 | grep -m 1 Educators | sed 's/"\(.*\)".*/\1/'

Name: Anonymous 2010-01-19 10:52

lol@haskel 440k

Name: Anonymous 2010-01-19 11:26

>>17
CHE?

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).

Name: Anonymous 2010-01-19 13:43

>>22
it's enough to just quote the text and have it printed
That solution was already given, numbskull.

Name: Anonymous 2010-01-19 14:56

HURR IS A MEDAL

B======================D

KISS THE END LIKE THE WOMEN DO IN GOLF

Name: Anonymous 2010-01-19 15:31

>>22

Alright, fine, I'll be more specific.

Platform is Win32. Code must be compiled for this platform. Post the settings and the compiler you used along with your code so that I can check it for myself. Interpreted language programs are not allowed unless they have been compiled. Compiling to ``bytecode'' does not count as compiling; it has to be a native Win32 executable. Programs cannot rely on external libraries; therefore, one cannot simply wget the quote from this thread without compiling it as part of the executable, which would almost certainly cost too much space to be worth it.

Note that you can save only so much space with compiler optimizations. You will have to find a way to compress the text to pass the 10k barrier.

Name: Anonymous 2010-01-19 15:43

>>25
How can you post a compiler on a BBS?

Name: Anonymous 2010-01-19 15:55

>>22
You can get shorter than "quote the text and have it printed" in any interpreted language worth using - Python, Perl, Lua, even Ruby.


k = " program"
print(string.format("Educators, generals, dieticians, psychologists, and parents%s. Armies, students, and some
societies are%smed. An assault on large problems employs a
succession of%ss, most of which spring into existence en route.
These%ss are rife with issues that appear to be particular to
the problem at hand. To appreciate%sming as an intellectual
activity in its own right you must turn to computer%sming; you
must read and write computer%ss -- many of them. It doesn't
matter much what the%ss are about or what applications they
serve. What does matter is how well they perform and how
smoothly they fit with other%ss in the creation of still greater
%ss. The%smer 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%ss written in a dialect
of Lisp for execution on a digital computer. Using Lisp we
restrict or limit not what we may%s, but only the notation for
our%s descriptions.",k,k,k,k,k,k,k,k,k,k,k,k,k,k))

Newlines added for readability; it won't run with them, but you get the idea.

Name: Anonymous 2010-01-19 16:03

>>27
Implying that Python is a better language than ruby

>>25
Platform is Win32.
( ≖‿≖)

Name: Anonymous 2010-01-19 16:27

>>26

( ≖‿≖)

>>27

( ≖_≖)

Name: Anonymous 2010-01-19 16:29

>>28
implying >>27-kun used Python

Name: Anonymous 2010-01-19 16:57

>>27
Perhaps you have completely failed to understand the challenge. Compress the fucking string.

Goddamn it, does no one read their SICP?!

Name: Anonymous 2010-01-19 17:24

>>1
gay

Name: Anonymous 2010-01-19 18:03

>>31
That's exactly what he did.  Stop whining.

Name: 22 2010-01-19 18:04

>>25

.586
.model flat,stdcall
option casemap:none

   include windows.inc
   include user32.inc
   include kernel32.inc
  
   includelib user32.lib
   includelib kernel32.lib

.code
   ; merged .text and .data sections
   szText db "Educators, generals, dieticians, psychologists, and parents program. Armies, students, and some societies are programmed. "
          db "An assault on large problems employs a succession of programs, most of which spring into existence en route. These programs "
          db "are rife with issues that appear to be particular to the problem at hand. To appreciate programming as an intellectual activity "
          db "in its own right you must turn to computer programming; you must read and write computer programs -- many of them. "
          db "It doesn't matter much what the programs are about or what applications they serve. "
          db "What does matter is how well they perform and how smoothly they fit with other programs in the creation of still greater programs. "
          db "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, "
          db "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 "
          db "the notation for our program descriptions"
   ; pointer abuse
   szCaption db ".",0

start:
    invoke MessageBox,0,offset szText,offset szCaption,MB_OK
    invoke ExitProcess,eax

end start


Compile with:

ML /c /coff /Cp /nologo /I"C:\Masm32\Include" "toy_msg.asm"
LINK /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /MERGE:.rdata=.text /ALIGN:16 /LIBPATH:"C:\Masm32\Lib" /OUT:"toy_msg.exe" "toy_msg.obj"


This gives me a 1712byte executable.
The text is 1053 bytes uncompressed (including null byte).
Executable code takes about 0x25 bytes. Rest is used by the PE header, a short section header(only one section), and the imports(merged in with the .text section, and the .text which is part of the code section as well, as it's immutable).
It can be further packed to about 1320(MEW)-1353(FSG) bytes using MEW, which abuses how the PE file is constructed and can compress code/data. (I tried other packers, most gave worst results as they don't abuse the PE file format as much). I could probably make this much smaller than it already is by using my own packer for the text (I estimate some 200-300 bytes at least for the unpacking code and ~500 bytes for the compressed code. Abusing the PE file format more could mean less space spend on the header using tricks such as those described here: http://www.phreedom.org/solar/code/tinype/ ), on the other hand, 1320 bytes is enough for me, and I don't really feel like wasting more time on a silly challenge unless I have something to gain from it.

Name: Anonymous 2010-01-19 19:52

import zlib, base64
print zlib.decompress(base64.b64decode('eJxdUzGS2zAM/Ao6N3f+QKoUKTKTMpm0R1OwxDmSUAjwFP0+C8o+e9J4aGK5WOxC36Yeg0nTF5q5cgsZpymxpZhCxXnVPS6SZU5q+BvqRGtoXE1pbTK3UM70tZXEKKr1ySsHTKUwfqKTsRIe3V8UnvCoUlANPRtJpRzaPOqXzEWJy5plxyPSHiOrJmDkeidAhyJqfrMtKS6ka0t1plRNiP9CKtfIxJWadOMz/VxYP9sfWlq6Mm3JFkqqHQJtCUZhXTk0As2FfVD40PNxYcunQAJywYwgFn/SGG7ZYz7XEtCmuiLOmaP1kClESx/JdtxSgoGyQWCaF6NdOpWOiay36s2ilBXK2zPllwescZiGyVtL6Ps/Wun1lUqouzsE3cjou9EkrPVkKJhjS4dxmw99m+zhTbjANpJ2lDFgTtgSZOAu8U7K7QOu/vaqs94pk9IiG20Y+QCu3K7SypDqFS0ituT9qF6THQng7lk87HFJEVPaLXi1BM7Zb56QI9jHVrXDHGV+pws4R3t4f18exDmUhIn/9BCHO1FGPIDAI++LGS4i70NBx9IA8/Z2a3E6+YhXiShMvrbPMl+weRz7cRwfAD6H/XlrR1pYTR8w4CsL3tkBP5KuoG0PBid3yJwMi3PP90y/1Hdr4DfsMKu1FEdUORXYWcWO0FAtYb+3fqGLB1oP5x11OOs9pX8aShNrbGkdUZ//ATm9glc='))


779 bytes. AND ANON TAKES THE LEAD!

Name: Anonymous 2010-01-19 19:55

>>35
Too bad it doesn't fit >>25's requirements.

Name: Anonymous 2010-01-19 19:57

>>36
Yeah, that guy can go fuck himself. Since when are programming contests about dicking around with compiler settings??

Name: Anonymous 2010-01-19 20:28

#!/bin/sh
curl http://dis.4chan.org/read/prog/1263880828/|dd bs=1 skip=2282 count=1052|cat

Name: Anonymous 2010-01-19 20:30

(which is sligthly less than >>19's solution without the #!/bin/sh)

Name: Anonymous 2010-01-19 21:13

>>34

CONGRATULATIONS

        ()
        ()
        ()
        ()
        ()
    -----------
   /           \
  /   /prog/    \
 |               |
 | \       ----- |
 |  \     /   o \|
  \  -----    __/
   \------\___\/
    -----------


It is my honor to bestow this upon you, and I hope you will do the same for future generations.

Name: 34 2010-01-20 0:00

Looks like I managed to beat my own record at this:

.586
.model flat,stdcall
option casemap:none

   include windows.inc
   include user32.inc
;  include kernel32.inc
  
   includelib user32.lib
;  includelib kernel32.lib


.code

    textCompressedBlob dd 75640045h, 6F746163h, 2C077372h, 6E656720h, 6C181F2Fh, 0F6696415h, 0EB63E674h, 199D6EF1h, 87791E70h, 276C6F68h, 74ADFF67h, 64289B1Fh, 6D72AB26h
    dd 0DF101A56h, 6D622C63h, 0CF41CB2Eh, 3BB1645Dh, 0A3647544h, 1F3F2734h, 0B726D6Fh, 3C4D8D63h, 326B46FFh, 6B643066h, 73266E67h, 6C75A31Fh, 766FDB74h, 673ECA16h, 0BB629E20h, 85A6DB6h
    dd 79E69BF7h, 0A082416Bh, 6E7C7AC7h, 666A4969h, 0D3C5CD41h, 1280DCF6h, 0AAA36877h, 32DD4C9Eh, 0BA676ECFh, 78CB0C08h, 0DABAA78h, 14B66C87h, 756C6068h, 6854DA18h, 0E87F8868h, 6662CC8Ch
    dd 0AD770ACEh, 5EB47A74h, 14A159CAh, 0B8A4B961h, 3CDFFB70h, 6A628F33h, 0A0081461h, 0D01184A2h, 0FDB7A140h, 0E4ACFA55h, 33A36FB3h, 742E9E54h, 8C21E0A7h, 0F4CFEE3Bh, 6C658692h, 1A634864h
    dd 20B1EF7Dh, 9B76690Eh, 542D79E4h, 556F4106h, 67F0A177h, 799ACA68h, 0E7D220A7h, 72285016h, 63736D6Eh, 0BAAB70FEh, 3B5338EDh, 0E23127A5h, 65236461h, 0F0807736h, 0B6B32E8Fh, 0DB528E2Dh
    dd 66FAD440h, 0A4A6B892h, 647D6A49h, 276EE6A0h, 5133BEFFh, 3992AA2Ch, 0CBAB7773h, 0DE1C4457h, 375B6212h, 77482478h, 696CE214h, 84A5266Ah, 0AC2C1B73h, 76497EBEh, 3C573456h, 53635624h
    dd 2C144869h, 506C7734h, 708829F3h, 6D8E6619h, 1A03AB4Dh, 0F9EFDF73h, 4A046C32h, 2BBC661Eh, 69293482h, 32EC04BDh, 0E6AF6393h, 1EF97412h, 3EA976F4h, 0A5E724D1h, 568FD924h, 201D9378h
    dd 906BF49Eh, 7FA9D1BFh, 4463567Dh, 8A43CF52h, 4865E678h, 63249071h, 34DD6E1Eh, 502325B0h, 0C4457824h, 6B2978BFh, 4A9CB782h, 69601C24h, 69279C63h, 6DD220E3h, 0DE8E3363h, 2C4DA7BCh
    dd 7594657Ah, 1CD0B24h, 9B790F34h, 69AE4AB6h, 4FE19B28h, 28665DF6h, 4C21817Ah, 0AF70AC99h, 68424A72h, 674623BAh, 0E04CD462h, 55A30BB4h, 5C080A09h, 0D7774430h, 92C83DC4h, 0AB3563A6h
    dd 276DA309h, 0B2AF6E4Fh, 0A13DB566h, 7B597995h, 44629102h, 7A6E49D1h, 5A562690h, 0EB457441h, 0E2B2512Dh, 0D20F63A2h, 2EEB33h
    db    0
   
.data?
    szText db 041Bh dup(?)
    szCaption db 2 dup(?)
.code
 
start:
    push offset szText
    push offset textCompressedBlob   
    call aP_depack_asm
    add esp,8
    invoke MessageBox,0,offset szText,offset szCaption,MB_OK
   
    ;removing this call, even though it's not really proper, but should work on NT and 9x, as long as you're not using some weird PE packers
    ;invoke ExitProcess,eax
    ret
   
;; Compression function   
aP_depack_asm:
    ; aP_depack_asm(const void *source, void *destination)

    _ret$  equ 7*4
    _src$  equ 8*4 + 4
    _dst$  equ 8*4 + 8

    pushad

    mov    esi, [esp + _src$] ; C calling convention
    mov    edi, [esp + _dst$]

    cld
    mov    dl, 80h
    xor    ebx,ebx

literal:
    movsb
    mov    bl, 2
nexttag:
    call   getbit
    jnc    literal

    xor    ecx, ecx
    call   getbit
    jnc    codepair
    xor    eax, eax
    call   getbit
    jnc    shortmatch
    mov    bl, 2
    inc    ecx
    mov    al, 10h
getmorebits:
    call   getbit
    adc    al, al
    jnc    getmorebits
    jnz    domatch
    stosb
    jmp    nexttag
codepair:
    call   getgamma_no_ecx
    sub    ecx, ebx
    jnz    normalcodepair
    call   getgamma
    jmp    domatch_lastpos

shortmatch:
    lodsb
    shr    eax, 1
    jz     donedepacking
    adc    ecx, ecx
    jmp    domatch_with_2inc

normalcodepair:
    xchg   eax, ecx
    dec    eax
    shl    eax, 8
    lodsb
    call   getgamma

    cmp    eax, 32000
    jae    domatch_with_2inc
    cmp    ah, 5
    jae    domatch_with_inc
    cmp    eax, 7fh
    ja     domatch_new_lastpos

domatch_with_2inc:
    inc    ecx

domatch_with_inc:
    inc    ecx

domatch_new_lastpos:
    xchg   eax, ebp
domatch_lastpos:
    mov    eax, ebp

    mov    bl, 1

domatch:
    push   esi
    mov    esi, edi
    sub    esi, eax
    rep    movsb
    pop    esi
    jmp    nexttag

getbit:
    add    dl, dl
    jnz    stillbitsleft
    mov    dl, [esi]
    inc    esi
    adc    dl, dl
stillbitsleft:
    ret

getgamma:
    xor    ecx, ecx
getgamma_no_ecx:
    inc    ecx
getgammaloop:
    call   getbit
    adc    ecx, ecx
    call   getbit
    jc     getgammaloop
    ret

donedepacking:
    sub    edi, [esp + _dst$]
    mov    [esp + _ret$], edi ; return unpacked length in eax

    popad

    ret



end start


;    This product uses the aPLib compression library,
;    Copyright © 1998-2009 by Jørgen Ibsen, All Rights Reserved.
;    For more information, please visit: http://www.ibsensoftware.com/

Compile this with the same settings as in >>34, but this won't give you a tiny file as it generates a .data section and masm won't let you use code in the header and similar things.
To minimize filesize, I used aplib's own compression to decompress the string, and the decompressor is fairly tiny itself, after that I abused the PE format quite a bit by moving the PE header into the DOS header(partially), and moving part of the data into the header. This is by 104 bytes smaller than the MEW compressed executable. Since most of the optimizations were done by hand in a hex editor, with the help of a PE editor, I can't give you a program which does it(I could write one, but I don't really plan on doing this more than once, so I just did it by hand), however I can post the executable here,

toy_msg3.exe.base64:

TVqQAABzdXAgL3Byb2cvP1BFAABMAQEAAAAAAAAAAAAAAAAA4AAPAQsBBQygAwAAIAQAAAAAAACh
AwAAEAAAAKAFAAAAAEAAEAAAABAAAAAEAAAABAAAAAQAAAAAAAAAkgUAAAACAAAAAAAAAgAAAAAA
EAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAAeAQAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaGF4bXlsc3CSAwAAAAIAAKADAAAA
AgAAAAAAAAAAAAAAAAAAIAAAYHgFAAAAAAAAAAAAAAAAAABFAGR1Y2F0b3JzBywgZ2VuLx8YbBVk
afZ05mPr8W6dGXAeeYdob2wnZ/+tdB+bKGQmq3JtVhoQ32MsYm0uy0HPXWSxO0R1ZKM0Jz8fb21y
C2ONTTz/RmsyZjBka2duJnMfo3VsdNtvdhbKPmcgnmK7tm1aCPeb5nlrQYKgx3p8bmlJamZBzcXT
9tyAEndoo6qeTN0yz25nuggMy3h4qqsNh2y2FGhgbHUY2lRoaIh/6IzMYmbOCnetdHq0XspZoRRh
uaS4cPvfPDOPYmphFAigooQR0ECht/1V+qzks2+jM1SeLnSn4CGMO+7P9JKGZWxkSGMafe+xIA5p
dpvkeS1UBkFvVXeh8Gdoypp5pyDS5xZQKHJubXNj/nCruu04UzulJzHiYWQjZTZ3gPCPLrO2LY5S
20DU+maSuKakSWp9ZKDmbif/vjNRLKqSOXN3q8tXRBzeEmJbN3gkSHcU4mxpaialhHMbLKy+fkl2
VjRXPCRWY1NpSBQsNHdsUPMpiHAZZo5tTasDGnPf7/kybARKHma8K4I0KWm9BOwyk2Ov5hJ0+R70
dqk+0STnpSTZj1Z4kx0gnvRrkL/RqX99VmNEUs9DinjmZUhxkCRjHm7dNLAlI1AkeEXEv3gpa4K3
nEokHGBpY5wnaeMg0m1jM47evKdNLHpllHUkC80BNA95m7ZKrmkom+FP9l1mKHqBIUyZrHCvckpC
aLojRmdi1EzgtAujVQkKCFwwRHfXxD3IkqZjNasJo20nT26vsma1PaGVeVl7ApFiRNFJbnqQJlZa
QXRF6y1RsuKiYw/SM+suAABowARAAGhAAUAA6BcAAACDxAhqAGjbCEAAaMAEQABqAOiqAAAAw2CL
dCQki3wkKPyygDPbpLMC6G0AAABz9jPJ6GQAAABzHDPA6FsAAABzI7MCQbAQ6E8AAAASwHP3dT+q
69ToTQAAACvLdRDoQgAAAOsorNHodE0TyesckUjB4Ais6CwAAAA9AH0AAHMKgPwFcwaD+H93AkFB
lYvFswFWi/cr8POkXuuOAtJ1BYoWRhLSwzPJQeju////E8no5////3Lywyt8JCiJfCQcYcP/JTAB
QADMzKAEAAAAAAAAAAAAALYEAAAwAQAAAAAAAAAAAAAAAAAAAAAAAAAAAACoBAAAAAAAALEBTWVz
c2FnZUJveEEAdXNlcjMyLmRsbA==

1216 bytes total. My old record was 2816 uncompressed, and 1320 compressed MEW PE executable.

Name: 41 2010-01-20 0:15

It should also be possible to save some ~8-16 bytes by moving one of the import strings into the header, but oh well, it's all diminishing returns from here on.

Name: Anonymous 2010-01-20 0:34

Name: Anonymous 2010-01-20 11:16

>>43

Get out, K(s) devs.

Name: Anonymous 2010-01-20 11:19

>>44
lol'd

Name: Anonymous 2010-01-20 14:25

do your own homework

Name: Anonymous 2010-01-20 21:15

>>44
wat

Name: Anonymous 2010-01-20 22:21

>>41
I think <1024 bytes is possible if you write your own decompressor, but that's probably the lower limit. I could get the string compressed to ~500 bytes with something like 7z, but then your decompressor is larger than your compressed data.

Name: Anonymous 2010-01-21 0:04

#include <stdio.h>

int main (void)
{
    FILE *ifp, *ofp;
    char[30] temp;
    ifp = fopen("x.txt", r);

    while (!feof(ifp)) {
       fscanf(ifp, "%s", temp);
       printf("%s ", temp);
    }
    return 0;
}


x.txt contains
"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."

Name: Anonymous 2010-01-21 1:19

>>49
Bunch of fucking cheaters.

Name: Anonymous 2010-01-21 1:54

>>50
u mad?

Name: sage 2010-01-21 3:29

Fucking useless shit thread

Name: Anonymous 2010-01-21 7:47

>>34
Or you could use a flat binary, you know

Name: Anonymous 2010-01-21 13:30

>>52

Are you frustrated?

Name: Anonymous 2010-01-21 16:08

>>49
Fuck off asshole.

Name: Anonymous 2010-01-21 19:04

>>48
I (>>41) did include my own decompressor(not made by me, but aPlib which is one of the tiniest decompressors out there). The compressed text is about 0x26B (621)bytes long, I think it may be possible to compress it down to ~5xx bytes, but it will take a better compressor. Decompressor code is 0xA9 (165 bytes). After that you have, some 70 (0x46) bytes worth of imports(table), 0x26(30) bytes actual messagebox display code(and decompressing), and about 0x140 (320) mandatory header/section code. The problem is that you can't reduce the mandatory PE header by much, so this overhead will still exist. You can try to have dual use for the header, but it's tricky and hard to test(getting the PE loader to accept your barely legal PE header). If you used some more primitive format than the PE, without any mandatory fields (like DOS COM format which is raw machine code), you could probably only need: compressed text+decompression code+text display code. In this case, I need 822 bytes for this, not including header and imports, which is less than 1052(total uncompressed text), but is not less than the total file size(mandatory PE header + import).

Name: Anonymous 2010-01-21 19:46

>>49
Your code sucks donkey balls


FILE *ifp, *ofp;
ofp isn't used

ifp = fopen("x.txt", r);
it's "r"

fscanf(ifp, "%s", temp);
...


#include <stdio.h>

int main (void)
{
    FILE *ifp;
    char c;
    if((ifp = fopen("x.txt", "r")))
        while((c = fgetc(ifp)) != EOF)
            putchar(c);
    fclose(ifp);
    return 0;
}

IHBT

Name: Anonymous 2010-01-21 19:47

>>57
Oh yeah, no fclose() either

Name: Anonymous 2010-01-21 22:16

putStrLn $ permutations " ',-.;AEILTUW`abcdefghiklmnopqrstuvwxy" `genericIndex` i

i is 168232886201243962476554103488494956833083813071404451617331861483496770135280319824397206481339935425217542091944826890841567664615856477281939914194628748826053518654779989872188573470321914206603966168610757082482646167761110781480574840953003387193707815200661636834775960908420997880438552810366267727026110308568591511986533928138190600484062522066300073129689227426828885525871328611743626774765377353506081753997353403529765061111304057653193442878488819145895220286313131130259806761656167832625873787756909654713961481491274753345173203913144902499937173389073981311419124182804089626557437569263141158638922912241732012229583787622611959718346854726953129446000458968815830427769183554439446455988777280214729278121251715134418400992163275089120799687146317104906997375379663829016996303413540063034505596996130294379628111991558453595783331000613924015493511747516824438016482746992254980150235611073431713353751554802928409331527174566000190667835809730617581582361247592823336419213335761910814054075905506528340279605364214572227131344816102209231077194611902166629429428895319818625290589445747236882157654451465634314941493487614078263579306754171172847741932416530131900502250320125033481876679450066327426779830147741229210608426632841223613906658413224401456752072343023635896147194552736674208700020305890612531759294595677161254147736241882120167726147643145869312832676443521755896364532928547247493204335582472612432819109048340358276183239967896430754117027387164820924450995868307183064742787986683772443931656030018903765198063505117111805680088408426029529399160314403871345531437101458502062792733069901043330175067311502526652114926. Determining the shortest representation of this number in program code is left as an exercise to the reader.

Name: 59 2010-01-21 22:24

Sorry, not permutations. I shouldn't post in the morning. This is what I meant:

putStrLn $ replicateM 1052 " ',-.;AEILTUW`abcdefghiklmnopqrstuvwxy" `genericIndex` i

Name: Anonymous 2010-01-22 15:13

>>59,60
This gives me an idea for an algorithm to produce a tiny program that gives the required output:


shortest <- Infinity;
bestarray <- [];
for all 38! permutations of the character set:
 let i be the number representation of the message
 factor i into an array, N, of powers, and P, of primes
 if length(N+P) < shortest:
  shortest = length(N+P)
  bestarray <- [N,P]
write a program to compute the integer represented by bestarray and write its message representation to standard output.


OP never said it needed to take a finite amount of time.

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