home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.ascii-art      Infamous alt.ascii-art forum      9,209 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,087 of 9,209   
   Eli the Bearded to mitch@cgarbs.de   
   Re: [from archive] fractal.c   
   01 Oct 21 00:04:21   
   
   From: *@eli.users.panix.com   
      
   In alt.ascii-art, Christian Garbs   wrote:   
   > Colin Randall  wrote:   
   >> I once found a little program in a .sig that creates a fractal in ascii when   
   >> you run it. Here we go:   
   > I also have one lying around, but don't know the source.   
   > The output is not as pretty, but it is plain shell (no C, no floats).   
   >   - - - - - - - - - - - - - - - - 8< - - - - - - - - - - - - - - - -   
   >   
   > sh -c 'set 2 1 0 / . - + ^ : , ! %;y=70;for a in $* $*;do x=54;while [ \   
   > ${#s} -lt 79 ];do r=0;i=0;for b in % $*;do [ $(((q=r*r)+(t=i*i))) -ge 9\   
   > 999 ]&&break;i=$((y+(r*i)/32));r=$((x+(q-t)/64));done;s=$b$s;x=$((x-2))\   
   > ;done;y=$((y-6));echo $s;s=;done;'   
   >   
   >   - - - - - - - - - - - - - - - - >8 - - - - - - - - - - - - - - - -   
      
   I'd suggest one change to help that be prettier: |tr % " "   
   Added right before $s is reset to empty:   
      
   sh -c 'set 2 1 0 / . - + ^ : , ! %;y=70;for a in $* $*;do x=54;while [ \   
   ${#s} -lt 79 ];do r=0;i=0;for b in % $*;do [ $(((q=r*r)+(t=i*i))) -ge 9\   
   999 ]&&break;i=$((y+(r*i)/32));r=$((x+(q-t)/64));done;s=$b$s;x=$((x-2))\   
   done;y=$((y-6));echo $s|tr % " ";s=;done;'   
      
   2222222222222222111111000000000000000000///.+,+..111111111111111111111111111111   
   2222222222222100000000000000000000///////...-^: :   /////1111111111111111111111   
   222222222220000000000000000000/////////....+:     ^+-..//////001111111111111111   
   222222222000000000000000000/////////...-+^:          +.....////0001111111111111   
   222222200000000000000000////////-+---+++::,         ,^^+-------//00000111111111   
   222222000000000000000/////...-+,                         !,  ,! :.0000001111111   
   222200000000000000........----^:!                               -..000000011111   
   22220000000000.........---+^:                                  :++-./0000000111   
   22200000--, !:++:  ::+++^^^,                                      :.//000000011   
   22......-++:             !!                                      !-///000000001   
   22.....^:,                                                       +..///00000001   
   22++::                                                         ^-...///00000000   
   22:                                                           :+-..////00000000   
   22.... ,:!                                                      :-.////00000001   
   22......+++!                                                      -.///00000001   
   222/....--^    :!     :::::,                                     ^+.//000000011   
   2220000000000---+.....--+++^,                                  !:::./0000000111   
   22220000000000000.........---:                                 :-../00000011111   
   22222000000000000000////....--+:!                               :./000000111111   
   22222220000000000000000///////-!,, ,^^! !,           ,: ,----+^:.00000111111111   
   22222222000000000000000000/////////.----+^^         ,+-.....////000111111111111   
   22222222220000000000000000000/////////....,       ,: .../////000111111111111111   
   22222222222200000000000000000000////////....+^:  ,+--//////11111111111111111111   
   22222222222222211110000000000000000000////..-,,--../111111111111111111111111111   
      
      
   And here it's reworked to be a nice bricktext:   
      
   sh -c 'c="2 1 0 / . - + ^ : , ! %";y=70;for a in $c $c; do x=54;   
   while [ ${#s} -lt 79 ];do r=0; i=0;for b in % $c;do [ $(((q=r*r)   
   +(t=i*i))) -ge 9999 ]&&break;i=$((y+(r*i)/32));r=$((x+(q-t)/64))   
   done;s=$b$s;x=$((x-2));done;y=$((y-6));echo $s|tr % " ";s=;done'   
      
   Elijah   
   ------   
   probably not all /bin/sh will be happy with that   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca