Jump to content
Sign in to follow this  

Quicando a bola...

Recommended Posts

Num forum que participo alguém pediu para resolver um problema escolar envolvendo uma "bola que quica" (bouncing ball)... Minha resposta, na forma dessa obra de arte (IOCCC):

/* ball.c */
/* Compile with: 'gcc -ansi -o ball ball.c -lm' */
/* Works on linux */
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <sys/ioctl.h>
             main() {
         short a[4];ioctl
    b,c,d=*a,e=a[1];float f,g,
 2,m=d/4,n=.01*e,o=0,p=.1;while (
79383)){for (b=c=0;h=2*(m-c)/i,f=-
b%e)==0)printf("\x1B[%dm ",g*g>1-h

Infelizmente o forum não usa fonte monoespaçada para códigos-fonte (deveria)... dai, eis a captura do código acima, em imagem:



  • Curtir 2

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...