IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2011/borsanyi - Best data utility

Bar graph plotter

Author:

To build:

    make

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 2011/borsanyi in bugs.html.

To use:

    ./borsanyi < some_data_file

Try:

    ./try.sh

Judges’ remarks:

This is a nice quick histogram plotter. A useful utility when you need to look at the distribution of some data.

Challenges:

You can modify the number of histogram bins and the scaling of the histogram by editing the source. Try to find them!

If you look at the source you will notice that the usual array of histogram bins is missing. The source contains no arrays and it does not use malloc(3) or alloca(3). How does it build the histogram?

While the input does not need to be sorted, the histogram output is sorted. How does it put the data into buckets? Why does it fork(2) 22 times?

Author’s remarks:

This small piece of program is meant to be a useful tool, when there are some data around and you need a quick glance at the histogram. I am all too often logged in to a remote machine with slow X connection, and a terminal-based program would be of great help.

Limitations

Obfuscation

Inventory for 2011/borsanyi

Primary files

Secondary files


Jump to: top