Files
Cody Boone Ferguson 3deb7ae603 Improve markdown guidelines wording
Amongst the changes here is that we do not need to have the hex or html
code (numbers) for open and close parentheses (in links) as there are
names. '(' is & followed by lpar; and the ')' is the same but 'rpar;'
instead. This makes it easier to remember and type and it generates the
same html as well (they are all valid). Now the markdown files are
consistent in this (in some cases hex was used and in others the html
code).

Although many markdown files were updated no html files needed to be
updated as it generates the same html. Even so I ran the appropriate
rules to do so just to verify this.
2024-07-31 10:44:10 -07:00

3.3 KiB

To build:

    make

There is a 121 byte version provided by the author. See Alternate code below.

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 2014/maffiodo2 in bugs.html.

To use:

    ./prog arg

Try:

    ./try.sh

Alternate code:

This shorter version is provided by the author. It has a fixed ramp and so not as fun but it's 121 bytes instead of 140.

Alternate build:

    make alt

Alternate use:

    cat image.rgb | ./prog.alt

Judges' remarks:

On the face of it :-) given what this program does one might wonder what makes this winning entry special. But when you realize the source is small enough for posting to social media that has a small size limit.

Who will be the first to tweet this source? How many re-tweets will such tweet get? And how many people will really understand the tweet?

Judges' 2023 update: Last year we would have referred to a toot, as in a Mastodon toot. This year we might have mentioned the term publish although we remain fond of the historic Mastodon term, toot.

Author's remarks:

Remarks

This program convert an image to an ASCII ART. The program reads a raw RGB image from stdin and print the ASCII ART to stdout.

The build process will raise some warnings about:

  • declaration specifier missing, defaulting to 'int'
  • implicitly declaring library function

The program will crash if run without parameters.

Screen size

If you have a terminal geometry than is different from the common 80x25 you can modify the output width by changing the value of the first variable:

    d=80,

Something to try

Type this:

    cat image.rgb | ./prog "  .:;Y0"

You can use your own image. Convert the image to a raw RGB image. Using ImageMagick it's very simple:

    convert -geometry 80x source.jpg image.rgb

This program require one parameter or it will crash. The parameter of the program is the conversion ramp. You can use different ramps or create your own (for example using some letters of your name).

These are some ramps you can try:

    ./prog " :1"
    ./prog "  .:;Y0"
    ./prog " .:-=+*#%@"
    ./prog "   .,:!-iots&8%#@$"

121 byte version

An alternative version of this program is only 121bytes long:

    d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}

This alternative version has a fixed ramp. It's smaller but it's not so fun to use...