Dibuja una casa ASCII

25

Esta es una ventana:

---
| |
---

Agreguemos algunas paredes |. Coloque dos espacios a cada lado para que la ventana tenga suficiente espacio.

|  ---  |
|  | |  |
|  ---  |

Ahora agreguemos un techo y un techo. Para mantener la ventana en el medio de la habitación, agreguemos una fila más arriba y debajo.

---------
|       |
|  ---  |
|  | |  |
|  ---  |
|       |
---------

Ahora, solo agrega un techo. Ponga una barra tan a la izquierda como sea posible, y una barra invertida lo más a la derecha posible, y tenemos esto:

/       \
---------
|       |
|  ---  |
|  | |  |
|  ---  |
|       |
---------

Luego mueva la barra hacia arriba una y la derecha. Mueva la barra invertida hacia arriba una hacia la izquierda:

 /     \
/       \
---------
|       |
|  ---  |
|  | |  |
|  ---  |
|       |
---------

Repita hasta que las dos barras se encuentren, luego agregue un asterisco donde se encuentran:

    *
   / \
  /   \
 /     \
/       \
---------
|       |
|  ---  |
|  | |  |
|  ---  |
|       |
---------

¡Y tu estas listo! Esta es una casa de 1x1. una casa de 2x2 se vería así:

        *
       / \
      /   \
     /     \
    /       \
   /         \
  /           \
 /             \
/               \
-----------------
|       |       |
|  ---  |  ---  |
|  | |  |  | |  |
|  ---  |  ---  |
|       |       |
|-------|-------|
|       |       |
|  ---  |  ---  |
|  | |  |  | |  |
|  ---  |  ---  |
|       |       |
-----------------

y una casa de 3x2:

            *
           / \
          /   \
         /     \
        /       \
       /         \
      /           \
     /             \
    /               \
   /                 \
  /                   \
 /                     \
/                       \
-------------------------
|       |       |       |
|  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |
|       |       |       |
|-------|-------|-------|
|       |       |       |
|  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |
|       |       |       |
-------------------------

El reto

Debe escribir un programa completo que tome dos enteros, x e y, e imprima una casa que tenga X cuartos de ancho y Y cuartos de alto. Su programa debería poder manejar casas de hasta 10x10. IO puede estar en cualquier formato razonable. Se permiten espacios finales en cada línea y se permite una nueva línea final.

La respuesta más corta en bytes gana.

DJMcMayhem
fuente

Respuestas:

12

Vim 122 , 89 pulsaciones de teclas

"aDJ"bD9i-<esc>Y2pVr <C-v>jr|$.Y4p3l<C-v>jljlr-jR| |<esc>{l<C-v>}d@apjdG@bp}Vr-{YPVr r/$r\qqYPllxx|P@qq@qddr*

Pruébalo en línea!

He mejorado significativamente mis habilidades de vim-golf desde que publiqué esta respuesta, así que decidí volver y escribir todo esto desde cero. ¡Guardado treinta y tres bytes en el proceso!

Se supone que la entrada está en dos líneas separadas, de modo que el búfer se ve así antes de comenzar a escribir:

3
4

Tuve una explicación muy detallada, pero no tengo ganas de volver a escribirla desde el principio ...> _ <Consulte el historial de revisiones si aún desea verla.

DJMcMayhem
fuente
9

Python 3.6 (versión preliminar), 221 210 203 bytes

x,y=eval(input())
w=8*x+1;p='-'*w+'\n'
for v in['*',*[f'/{" "*i}\\'for i in range(1,w-1,2)],p+p.join([''.join(f'{"".join([f"|{(a*3)[:3]:^7}"]*x)}|\n'for a in(*' -','| |',*'- '))]*y)+p]:print(v.center(w))

Lee 2 enteros (separados por comas) de stdin, imprime la casa en stdout.

Versión legible:

x, y = eval(input())
w = 8 * x + 1 # total width (in characters)
p = '-' * w + '\n' # floors
for v in [
    '*', # asterisk
    *[f'/{" "*i}\\' for i in range(1, w-1, 2)], # roof
    p + p.join([''.join(f'{"".join([f"|{(a*3)[:3]:^7}"]*x)}|\n' for a in (*' -','| |',*'- '))]*y) + p # rooms
]:
    print(v.center(w))
vaultah
fuente
2
¿Qué característica / s 3.6.0a0 usa esto? ¿Solo f'{name}'formato de cadena?
gato
@tac: solo f-strings , sí
vaultah el
1
¿Cómo instalaste 3.6? He estado esperando ansiosamente las cadenas f, pero no pude encontrar la forma de instalarlo yo mismo (una vez más, el soporte de Cygwin no es excelente)
Sp3000
@ Sp3000: lo construí desde la fuente
vaultah el
@ Sp3000 Python 3.3+ no se basará en Cygwin.
Mego
7

Python 2, 190 181 bytes

w,h=input();W=w*4
for i in range(~W,h*6+1):print['-'[i%(h*6):]*(W-~W)or['  %s  '%' -|-  - -  -|- '[~i%6::5],'-'*7][i%6<1].join('|'*-~w),' '*~i+['/%*c'%(w*8-~i*2,92),'*'][W<-i]][i<0]

Estoy bastante seguro de que hay mucho para jugar golf, especialmente las ventanas, pero aquí hay algo por ahora. Ancho de entrada y altura separados por comas, p 1,2. Ej .

Explicación rápida y aproximada:

                *          <--- i = ~W = -w*4 - 1.    <---\
               / \         <--\ i = -W = -w*4             | Preceding spaces
              /   \           |                           | are calculated
             /     \          |                           | the same way
            /       \      <--/ i = -1                <---/
   /--->    ---------      <--- i = 0                 
   |        |       |      <--\ i = 1                 <---\
Check       |  ---  |         |                           | Calculate inner string
i%(h*6)     |  | |  |         |                           | and use to join '|'s
is zero     |  ---  |         |                           | (ditto with |-------|)
   |        |       |      <--/ i = h*6 - 1           <---/
   \--->    ---------      <--- i = h*6

            ^       ^
            \-------/

          W-~W = w*8 + 1
Sp3000
fuente
3

JavaScript (ES6), 292 270 238 215 200 bytes

¡Gracias @Neil por ayudar a recortar esto!

a=>b=>[(p=(c,d=' ')=>d.repeat(c))(m=4*a)+'*',...[...Array(m)].map((c,i)=>p(--m)+`/${p(i*2+1)}\\‌`),y=p(8*a+1,'-')].join`
`+p(b,`
`+[x=p(a,'|'+p(7)),w=p(a,'|  ---  '),p(a,'|  | |  '),w,x,y].join`|
`)

Llamar como: F(a)(b)

Construye el techo, luego ensambla la casa central con repeticiones de cuerdas en capas.

Mwr247
fuente
Cuando vi tu respuesta, pensé si deberías haber usado join`|\n` y ahora desearía haber comentado en ese momento. Hubiera sido una buena excusa para agregar a mi comentario parcial sugiriendo que lo use 9*aen algún momento, que nunca envié porque era demasiado corto.
Neil
Su fórmula 4*a-1parece incorrecta, creo que debería serlo 4*a, esto podría ahorrarle 4 bytes.
Neil
m-i-1se convierte --m. 9*a-ase convierte 8*a.
Neil
1
Ahora, en realidad no está utilizando ninguna plantilla en sus cadenas, y podría haber hecho `` *\n${[...Array(m)].map(...).join\ n }\n``, pero puede ir una mejor y unirse a la cadena antes y después al mismo tiempo:a=>b=>(p=(c,d=' ')=>d.repeat(c),[p(m=4*a)+`*`,...[...Array(m)].map((c,i)=>p(--m)+'/'+p(i*2+1)+'\\'),y=p(8*a+1,'-')].join`\n`+p(b,`\n`+[x=p(a,'| '),w=p(a,'| --- '),p(a,'| | | '),w,x,y].join`|\n`))
Neil
1
Afeitarse un byte más con `/${p(i*2+1)}\\‌`.
Neil
3

C ++, 282 bytes, corrige los problemas con la entrada anterior:

#include<cstdio>
int main(){for(int r=2,c=2,x,y,q,u,h=c*4,w=h*2,i=0;i<h+r*6+2;i++)for(q=0;q<w+2;q++)x=q%8,y=i%8,u=(i-h-1)%6,putchar(q==w+1?10:i<=h?!i&&q==h?42:i==h-q?47:i==q-h?92:32:!u&&x||!u&&(i<h+2||i==h+r*6+1)||(u==2||u==4)&&x>2&&x<6?45:!x||u==3&&(x==3||x==5)?124:32);return 0;}

Salida:

        *
       / \
      /   \
     /     \
    /       \
   /         \
  /           \
 /             \
/               \
-----------------
|       |       |
|  ---  |  ---  |
|  | |  |  | |  |
|  ---  |  ---  |
|       |       |
|-------|-------|
|       |       |
|  ---  |  ---  |
|  | |  |  | |  |
|  ---  |  ---  |
|       |       |
-----------------
Dave the Sax
fuente
3

Ruby, Rev B 165 bytes

w=1-2*r=-4*x=gets.to_i
puts (r-1..h=6*gets.to_i).map{|n|n<0?(n<r ??*:?/+' '*(w+n*2)+?\\).center(w):n%h<1?(?-*w):'|CCBABCC'.tr('CBA','   | \-'[1222>>n%6*2&6,3])*x+?|}

utiliza un solo bucle y varios otros trucos de golf.

Ruby, Rev A 179 bytes

w=1+8*x=gets.to_i
y=gets.to_i
b=(0..x*4).map{|n|(n<1??*:?/+' '*(n*2-1)+?\\).center(w)}
a=(2..y*6).map{|n|('|CCBABCC'.tr('CBA','   | \\-'[4888>>n%6*2&6,3]))*x+?|}
puts b,s=?-*w,a,s

Sin golf

  x=gets.to_i
  y=gets.to_i

  w=x*8+1                                  #calculate width of house

  b=(0..x*4).map{|n|                       #design a roof line by line
    (n<1??*:?/+' '*(n*2-1)+?\\).center(w)  #first line is *, second line is /[spaces]\
  }                                        #centre correctly to the width of the house by padding

  a=(2..y*6).map{|n|                       #design a front facade line by line
    ('|CCBABCC'.                           #template for each row
      tr('CBA','   | \\-'[4888>>n%6*2&6,3])#substitute CBA for 3 characters from the string according to magic number 4888
    )*x+?|                                 #we need x copies, finishing with a |
  }

  puts b,s=?-*w,a,s                        #print a roof, a line of -, a facade and another line of -
Level River St
fuente
Creo que puede soltar una barra diagonal inversa en la cadena, es decir | \-'.
Sp3000
@ Sp3000 Eso funciona, gracias. Supongo \-que no significa nada como una secuencia de escape, por lo \-que solo se analiza como 2 caracteres. Entonces, por supuesto, -tiene un significado especial tr, por lo que necesitamos la cadena ' \-'para que las ventanas escapen -(mapeo C-> espacio, B-> -y A-> -ya que no quedan más caracteres). Para los pisos, solo tenemos la cadena '-'y, en este caso, trparece feliz de interpretarla solo como un carácter literal en lugar de un carácter especial, asignando C = B = A = '-'En general, fue algo complicado ponerse a trabajar. Estoy seguro de que hay más golf que hacer, lo editaré más tarde.
Level River St
2

C ++, prueba de 258 bytes aquí

#include<cstdio>
int main(){for(int r=10,c=10,x,y,q,u,h=c*4,w=h*2,i=0;i<h+r*8+2;i++)for(q=0;q<w+2;q++)x=q%8,y=i%8,u=(i-(h+1))%8,putchar(q==w+1?10:i<=h?!i&&q==h?42:i==h-q?47:i==q-h?92:32:!u||(u==3||u==5)&&x>2&&x<6?45:!x||u==4&&(x==3||x==5)?124:32);return 0;}

Resultado:

                                        *                                        
                                       / \                                       
                                      /   \                                      
                                     /     \                                     
                                    /       \                                    
                                   /         \                                   
                                  /           \                                  
                                 /             \                                 
                                /               \                                
                               /                 \                               
                              /                   \                              
                             /                     \                             
                            /                       \                            
                           /                         \                           
                          /                           \                          
                         /                             \                         
                        /                               \                        
                       /                                 \                       
                      /                                   \                      
                     /                                     \                     
                    /                                       \                    
                   /                                         \                   
                  /                                           \                  
                 /                                             \                 
                /                                               \                
               /                                                 \               
              /                                                   \              
             /                                                     \             
            /                                                       \            
           /                                                         \           
          /                                                           \          
         /                                                             \         
        /                                                               \        
       /                                                                 \       
      /                                                                   \      
     /                                                                     \     
    /                                                                       \    
   /                                                                         \   
  /                                                                           \  
 /                                                                             \ 
/                                                                               \
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |       |       |
|       |       |       |       |       |       |       |       |       |       |
---------------------------------------------------------------------------------
Johan du Toit
fuente
1
Esto no coincide con la imagen de OP. El paso de los pisos es más alto, y en la imagen de OP solo las plantas superiores e inferiores son líneas continuas -. Los pisos intermedios se dividen con|
Level River St
@steveverrill Gracias por señalarlo, cometí exactamente el mismo error en mi propia presentación. fp .
DJMcMayhem
2

C #, 361 353 bytes

string b(int w,int h){string m="",s,f,o=m,x,y,n="\n",p="|",q=" ";int i=0,v=w*4;Func<int,string,string>r=(j,c)=>{for(s="";j-->0;)s+=c;return s;};m+=r(v,q)+"*\n";for(;i<v;)m+=r(v-i-1,q)+'/'+r(i++*2+1,q)+"\\\n";f=r(w*8+1,"-");m+=f;x=n+r(w,p+r(7,q))+p;y=n+r(w,"|  ---  ")+p;o=x+y+n+r(w,"|  | |  ")+p+y+x;for(i=1;i++<h;)m+=o+x.Replace(q,'-');return m+o+n+f;}

Programa completo:

using System;
class House
{
    static int Main()
    {
        var x = new House();
        Console.WriteLine(x.b(1,1));
        Console.WriteLine();
        Console.WriteLine(x.b(2,2));
        Console.WriteLine();
        Console.WriteLine(x.b(2,3));
        Console.WriteLine();
        Console.WriteLine(x.b(9,9));
        Console.WriteLine();
        Console.Read();
        Console.WriteLine(x.b(10, 10)); // Looks broken because Bash to small
        Console.Read();
        return 0;
    }

    string b(int w,int h){string m="",s,f,o=m,x,y,n="\n",p="|",q=" ";int i=0,v=w*4;Func<int,string,string>r=(j,c)=>{for(s="";j-->0;)s+=c;return s;};m+=r(v,q)+"*\n";for(;i<v;)m+=r(v-i-1,q)+'/'+r(i++*2+1,q)+"\\\n";f=r(w*8+1,"-");m+=f;x=n+r(w,p+r(7,q))+p;y=n+r(w,"|  ---  ")+p;o=x+y+n+r(w,"|  | |  ")+p+y+x;for(i=1;i++<h;)m+=o+x.Replace(q,'-');return m+o+n+f;}

    // Without extra vars
    string b1(int w, int h)
    {
        string m = "", s, f, o = m, x, y;
        int i = 0, v = w*4;
        Func<int,string,string> r = (j,c) => {
            for(s = ""; j-->0;) s += c;
            return s;
        };
        /// Roof
        m += r(v, " ") + "*\n";
        for (; i < v;) m += r(v - i - 1, " ") + '/' + r(i++ * 2 + 1, " ") + "\\\n";
        /// Ceiling
        f = r(w * 8 + 1, "-");
        m += f;
        /// Room
        x = "\n" + r(w, "|" + r(7, " ")) + "|";
        y = "\n" + r(w, "|  ---  ") + "|";
        o = x + y + "\n" + r(w, "|  | |  ") + "|" + y + x;
        for (i = 1; i++ < h;) m += o + x.Replace(' ','-');
        /// Floor
        return m + o + "\n" + f;
    }

    string build(int width, int height)
    {
        // House, tempStr, floor, room, x/y = room_row1/2
        string house = "", s, ceil, room = "", x, y;
        int i, v = width*4;
        Func<int,string,string> rep = (j,c) => {
            s = "";
            for(; j>0; j--) s += c;
            return s;
        };
        /// Roof
        house += rep(v, " ") + "*\n";
        for (i = 0; i < v;) {
            // LEFT Indent + '/' + Distance + '\'
            house += rep(v - i - 1, " ") + '/' + rep(i++ * 2 + 1, " ") + "\\\n";
        }
        /// Ceiling
        ceil = rep(width * 8 + 1, "-");
        house += ceil;
        /// Room
        x = "\n" + rep(width, "|" + rep(7, " ")) + "|";
        y = "\n" + rep(width, "|  ---  ") + "|";
        room = x + y + "\n" + rep(width, "|  | |  ") + "|" + y + x;
        for (i = 1; i < height; i++) {
            house += room;// + x.Replace(' ','-');
            house += "\n" + rep(width, "|" + rep(7, "-")) + "|";
        }
        /// Floor
        house += room + "\n" + ceil;
        return house;
    }
}
DW.com
fuente
Agradable, un par de consejos generales que se aplican aquí: puede guardar un puñado de caracteres al observar de cerca algunos de sus bucles for ( s=""se pueden poner dentro del bucle for (j) (considere también j-->0la condición, y i++<hen el último bucle), i=0se puede mover fuera del bucle for a la declaración guardando un byte. También puede guardar un byte reutilizando cadenas vacías asignadas (una vez masignado, puede asignar o=mguardar el "". Reemplazar también toma cadenas, por lo que puede use su en qlugar de ' ', y no hay necesidad de espacio después de >declarar r. Cosas pequeñas;)
VisualMelon
A veces son las cosas pequeñas las que marcan la diferencia. Gracias: D
DW.com
1

VBA, 284 bytes

Function H(W,S)
L=vbLf:H=Space(4*W)&"*"&L
For R=1 To 4*W:H=H &Space(4*W-R)&"/"&Space(2*R-1)&"\"&L:Next
J=".":P=String(W,J)&"|"&L
D=String(8*W+1,"-")&L
E=Replace(P,J,"|       ")
F=Replace(P,J,"|  ---  ")
H=H &Replace(String(S,J),J,D &E &F &Replace(P,J,"|  | |  ")&F &E)&D
End Function

La función Reemplazar es una herramienta ordenada para hacer múltiples copias de una manera que desafortunadamente la función de Cadena no quiere.

Invoque para obtener el mejor efecto en la ventana Inmediato del editor VBA: ?H(8,8)por ejemplo.

?H(8,8)
                                *
                               / \
                              /   \
                             /     \
                            /       \
                           /         \
                          /           \
                         /             \
                        /               \
                       /                 \
                      /                   \
                     /                     \
                    /                       \
                   /                         \
                  /                           \
                 /                             \
                /                               \
               /                                 \
              /                                   \
             /                                     \
            /                                       \
           /                                         \
          /                                           \
         /                                             \
        /                                               \
       /                                                 \
      /                                                   \
     /                                                     \
    /                                                       \
   /                                                         \
  /                                                           \
 /                                                             \
/                                                               \
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
|       |       |       |       |       |       |       |       |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |  | |  |
|  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |  ---  |
|       |       |       |       |       |       |       |       |
-----------------------------------------------------------------
Joffan
fuente