Files
ioccc/2015/endoh4
Cody Boone Ferguson 4bf3f302cb 'comments' -> 'remarks' in all README.md files
As in

    sgit -e 's/\([Aa]uthor.*\)comments/\1remarks/g' -e 's/\([Jj]udge.*\)comments/\1remarks/g' '*README.md'
2023-04-10 11:01:39 -07:00
..
2023-03-07 21:35:00 -08:00
2020-12-30 16:57:03 -08:00

Best One-liner

Yusuke Endoh
https://github.com/mame/
Twitter: @mametter

To build:

make

To run:

./prog <a number of arguments>

Try:

./prog @ @ @ @ @ @

./prog @ @ @ @ @ @ @ @ @ @ @ @

./prog $(perl -e 'print "@ " x (2*3*5*7);')

./prog $(< Makefile)

Alternate code:

An alternate version of this entry, prog.alt.c, is provided.
This alternate code does not contain improvements suggested by Gil Dogon; it is the author's original entry.

To compile this alternate version:

make alt

Use prog.alt as you would prog above.

Judges' remarks:

For this one liner it is best to avoid prime numbers. The output groups factors in the x-y dimensions. How many factors can be represented before you run out of command line argument space? How could you modify the program to experiment with numbers that have more or larger factors?

Author's remarks:

Visual factorization 1-liner. Try:

gcc -o prog prog.c
./prog @
./prog @ @
./prog @ @ @
./prog @ @ @ @
./prog @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

Inspired by Animated Factorization Diagrams.

prog.alt.c is the original version that I submitted. Gil Dogon kindly improved it during the review. Thank you!

This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:

Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

For more information, see: https://creativecommons.org/licenses/by-sa/4.0/