Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any reason to use C?

Author: Tord Romstad

Date: 12:31:11 07/29/03

Go up one level in this thread


On July 29, 2003 at 15:17:51, Dann Corbit wrote:

>Of course, you can get bizarre in C too (the "C Puzzle Book" is proof enough of
>that.)  I once had the displeasure of someone giving me a function that was a
>64K return statement.  He thought it was cute.

This is getting increasingly off-topic, but I cannot resist the temptation
to post the cutest little C program I have ever seen.  It computes an
approximation of pi by calculating its own area.  :-)


/*
  * Program to compute an approximation of pi
  * by Brian Westley, 1988
  * (requires pcc macro concatenation; try gcc -traditional-cpp)
  */

#define _ -F<00||--F-OO--;
int F=00,OO=00;
main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
{
             _-_-_-_
        _-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_
         _-_-_-_-_-_-_-_
             _-_-_-_
}



This page took 0.02 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.