Yusuke Endoh
https://github.com/mame/
Twitter: @mametter
make
./prog <a number of arguments>
./prog @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @ @ @ @ @
./prog $(perl -e 'print "@ " x (2*3*5*7);')
./prog $(< Makefile)
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?
Visual factorization 1-liner. Try:
gcc -o prog prog.c
./prog @
./prog @ @
./prog @ @ @
./prog @ @ @ @
./prog @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @
./prog @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
Inspired by Animated Factorization Diagrams.
EDIT: prog.orig.c
is the original version that I submitted. Gil Dogon kindly improved it during the review. Thank you!
© Copyright 1984-2016,
Leo Broukhis, Simon Cooper, Landon Curt Noll
- All rights reserved |