[SP-pm] Res: Write Binary!

Henrique Rennó henrique.renno em gmail.com
Quinta Abril 26 09:58:02 PDT 2007


Alguém aqui participa de maratonas de programação??? Curte algoritmos e
matemática??? Um cara postou na lista de discussões da maratona sobre um
tipo de competição totalmente ao contrário, tipo, em vez de saber utilizar
um algoritmo ou representar os dados de uma forma otimizada você deve fazer
da forma mais inimáginavel possível!!!

P.S.: Não tive a intenção de zoar o Ricardo Filipo pelo código... apenas o
comentário do Luis Motta me lembrou disso...

Unlike other programming contests, the goal of the OMGWTF contest is not to
flex your algorithmic muscles and solve some abstract computational problem
like you might in an ACM contest <http://icpc.baylor.edu/icpc/>. Nor is it
like the International Obfuscated C Coding Contest <http://www.ioccc.org/>;
in fact, writing code like that would be a surefire way to lose this
contest. Instead, the goal of the OMGWTF contest is to solve an incredibly
simple problem using the most obscenely convoluted way imaginable. And for
this first contest, the simple problem is to build and implement the logic
for a four-function calculator.

On 4/26/07, Luis Motta Campos <luismottacampos em yahoo.co.uk> wrote:
>
> On Apr 26, 2007, at 4:46 PM, Ricardo Filipo wrote:
> > Oi, Henrique.
> > Talvez o que vc precise seja o modulo Storable. Veja:
> > http://search.cpan.org/~ams/Storable-2.16/Storable.pm
> >
> > Senão basta escrever os dados binários no arquivo.
> > Abaixo uma matriz 5x5 com dados zero. Confira:
> >
> > <code>
> > for($i=1;$i<5;$i++){for($j=1;$j<5;$j++){$matriz[$i][$j]=0;}}
> > open (BINARIO, ">arq.bin"); binmode(BINARIO);
> > for ($i=1;$i<5;$i++){for($j=1;$j<5;$j++){print BINARIO $matriz[$i]
> > [$j];}}
> > </code>
>
>    Minhanossasenhoraacherupitadebaixo!
> Quasequeeunãoconsigolerestabagunçadecódigofonte,maseudesconfionquemeucom
> piladorCiagostardetentar...
>


-- 
Henrique
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://mail.pm.org/pipermail/saopaulo-pm/attachments/20070426/539f82c7/attachment.html 


Mais detalhes sobre a lista de discussão SaoPaulo-pm