7
\$\begingroup\$

Consider the following ASCII image of five concentric anti-aliased ASCII aureoles:

                 ........
            .@..............@.
        .....                .....
      .@..    ...@@@@@@@@...    ..@.
    .@.    ..@@..        ..@@..    .@.
   .@.   .@@.    ........    .@@.   .@.
  .@    @@    .@@@@@..@@@@@.    @@    @.
 .@    @.   .@@.          .@@.   .@    @.
 @.   @@   @@.   @@@@@@@@   .@@   @@   .@
.@   .@   .@.   @@@.  .@@@   .@.   @.   @.
.@   @@   @@   @@   @@   @@   @@   @@   @.
.@   @@   @@   @@   @@   @@   @@   @@   @.
.@   .@   .@.   @@@.  .@@@   .@.   @.   @.
 @.   @@   @@.   @@@@@@@@   .@@   @@   .@
 .@    @.   .@@.          .@@.   .@    @.
  .@    @@    .@@@@@..@@@@@.    @@    @.
   .@.   .@@.    ........    .@@.   .@.
    .@.    ..@@..        ..@@..    .@.
      .@..    ...@@@@@@@@...    ..@.
        .....                .....
            .@..............@.
                 ........

You must write a program to draw a given subset of the above circles in as few characters as possible.

The input is either five booleans in your choice of formatting (be it 1 1 1 1 1 or [False, True, False, False, True]), with the first boolean corresponding to the inner-most circle, or an integer where the least-significant bit corresponds to the inner circle (e.g. 1 0 0 1 1 is equivalent to 25).

Output for 1 1 1 1 1/31: see above.

Output for 1 0 1 0 1/21:

                 ........
            .@..............@.
        .....                .....
      .@..                      ..@.
    .@.                            .@.
   .@.           ........           .@.
  .@          .@@@@@..@@@@@.          @.
 .@         .@@.          .@@.         @.
 @.        @@.              .@@        .@
.@        .@.                .@.        @.
.@        @@        @@        @@        @.
.@        @@        @@        @@        @.
.@        .@.                .@.        @.
 @.        @@.              .@@        .@
 .@         .@@.          .@@.         @.
  .@          .@@@@@..@@@@@.          @.
   .@.           ........           .@.
    .@.                            .@.
      .@..                      ..@.
        .....                .....
            .@..............@.
                 ........

Output for 0 0 0 1 0/8 (note the leading whitespace):

              ...@@@@@@@@...
           ..@@..        ..@@..
         .@@.                .@@.
        @@                      @@
       @.                        .@
      @@                          @@
     .@                            @.
     @@                            @@
     @@                            @@
     .@                            @.
      @@                          @@
       @.                        .@
        @@                      @@
         .@@.                .@@.
           ..@@..        ..@@..
              ...@@@@@@@@...

The aureoles themselves must be exactly as presented above. However, trailing whitespace is optional. Also, if some outer aureoles are missing, it is up to you whether your program outputs the leading empty lines or the trailing empty lines.

\$\endgroup\$
  • 8
    \$\begingroup\$ Did you obtain permission from the American Association of Anti-Aliased ASCII Aureoles and Areolas (AAAAAAA) to use their logo? \$\endgroup\$ – COTO Oct 9 '14 at 10:54
  • 8
    \$\begingroup\$ @COTO I Believe the Big Best Body of Being did Bring Back the Bad Ban on using this logo without permission. Or, in short: BBBBBBBBB. \$\endgroup\$ – Doorknob Oct 9 '14 at 12:40
  • 11
    \$\begingroup\$ You diabolically dared defy the deviously demanding dataset describing the demerits deemed denunciable during the deconstruction of demotivationally dampening, diaper-rash-engenderingly devilish declamations such as dear Doorknob declaim did? (strained, I know) \$\endgroup\$ – Soham Chowdhury Oct 9 '14 at 15:11
  • 10
    \$\begingroup\$ Each entry earns extra exhortations for everyone's exceptionally elongated (and elegantly enumerated) English expressions. \$\endgroup\$ – COTO Oct 9 '14 at 17:20
  • 11
    \$\begingroup\$ For five fortnights, fanatics fought AAAAAAA/BBBB for fair-use of figures. Finally, failure followed. \$\endgroup\$ – Geobits Oct 9 '14 at 17:43
3
\$\begingroup\$

JavaScript (E6) 272 314

On par with the other JS answers, a function returning a string. Add 13 byte if an output statement is requested (console.log()).
The function parameter is an array of 5 truthy/falsy values.

Edit Shorter implementation of the same algorithm
The string at line 2 codify the lower right quarter of the rings. The others are obtained thanks to simmetry

  • ' ' space mark line end
  • digit (1..9) mark a sequence of blank spaces
  • hex digit (A..F or a..f) mark a sequence of symbols, if lowercase '.' else '@'

Rendering the lines, it checks the boolean params and output symbols or an equal number of spaces

F=f=>
  [for(c of(l=d=0,o=t=[],'A3B3B3B3Aa 1aC3aAa3Aa3Aa D3aB3B3aA1 5aBa3aA4Aa1 aEa4B4Aa2 d4aBa3aAa3 4bBb4aAa4 Dc4bAa6 8e8 cdAa66 d89 '))
   c<'1'?(l=(t=[o,...t,o]).length/5.1|0,d=1,o='')
   :o=(p=(-c||!f[l+=d]?' ':c>'F'?'.':'@').repeat(-c?(d=1,c):(d=0,'0x'+c-9)))+o+p]
  &&t.join('\n')

Test In FireFox/FireBug console

F([1,0,1,0,1]) (or F[1,,1,,1])

Output

                 ........                 
            .@..............@.            
        .....                .....        
      .@..                      ..@.      
    .@.                            .@.    
   .@.           ........           .@.   
  .@          .@@@@@..@@@@@.          @.  
 .@         .@@.          .@@.         @. 
 @.        @@.              .@@        .@ 
.@        .@.                .@.        @.
.@        @@        @@        @@        @.
.@        @@        @@        @@        @.
.@        .@.                .@.        @.
 @.        @@.              .@@        .@ 
 .@         .@@.          .@@.         @. 
  .@          .@@@@@..@@@@@.          @.  
   .@.           ........           .@.   
    .@.                            .@.    
      .@..                      ..@.      
        .....                .....        
            .@..............@.            
                 ........                 
\$\endgroup\$
  • \$\begingroup\$ How can I run this? If I paste it into Firefox 29's console I get a syntax error. \$\endgroup\$ – Claudiu Oct 14 '14 at 0:20
  • \$\begingroup\$ @Claudiu problems with cut & paste? I tried just now and it works (FireFox 32 with FireBug) \$\endgroup\$ – edc65 Oct 14 '14 at 4:36
4
\$\begingroup\$

JavaScript (ES5), 359 bytes

Place input into I, get output on stdout/console.

I=[1,1,1,1,1];a='-----  88880----8988888880--  88888--  0--8988- 66677770- 898- 667766- 0-898-6776- 44440  89- 77- 45555540 89- 76-4554-  0 98-77-554-3333089-67-454-3332 089-77-55-33-1'.replace(/-/g,'   ').split(0);for(i=11;i--;)a.push(a[i]+=a[i].split('').reverse().join(''));console.log(a.join('\n').replace(/\d/g,function(d){return I[d>>1]?'.@'[d&1]:' '}))
\$\endgroup\$
2
\$\begingroup\$

JavaScript ES6, 567b (WIP)

Execute this code in the JS/NodeJS console to display the result in the console.

the array "a" at the beginning contains the input.

a=[1,0,1,0,1];(z=a=>a+a.split("").reverse().join(""))(b=["                 0000","            010000000","        00000        ","      0100    2223333","    010    223322    ","   010   2332    4444","  01    33    4555554"," 01    32   4554     "," 10   33   554   7777","01   23   454   7776 ","01   33   55   77   9",""].map(z).join("\n")[r="replace"](/0/g,a[0]?".":" ")[r](/1/g,a[0]?"@":" ")[r](/2/g,a[1]?".":" ")[r](/3/g,a[1]?"@":" ")[r](/4/g,a[2]?".":" ")[r](/5/g,a[2]?"@":" ")[r](/6/g,a[3]?".":" ")[r](/7/g,a[3]?"@":" ")[r](/9/g,a[4]?"@":" "))[r]("\n\n","\n")
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.