Monday, April 9, 2012

make random-fractal

% cat Makefile
BASH=/bin/bash
ECHO=/bin/echo
SLEEP=/bin/sleep
BC=/usr/bin/bc
PRINTF=/usr/bin/printf

random-fractal: shell
        while ${SLEEP} 0.1 ; \
        do \
          if [ `${ECHO} $$RANDOM % 2 | ${BC}` -eq 0 ] ; \
          then \
            ${PRINTF} " " ; \
          else \
            ${PRINTF} "█" ; \
          fi ; \
        done ;
shell:
        $(eval SHELL := ${BASH})

% make

--
  = ^ . ^ =

No comments:

Post a Comment