## jeudi 5 novembre 2015

### Printing out a rhombic pattern in java with "for" loop

I am having a hard time doing a school exercise in Java. We are asked to print out this pattern:

``````+++++++++++++++++++++++++++++++++++++++++++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++    +++++    +++++    +++++    +++++
+++      +++      +++      +++      +++
+        +        +        +        +
+++      +++      +++      +++      +++
+++++    +++++    +++++    +++++    +++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++++++++++++++++++++++++++++++++++++++++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++    +++++    +++++    +++++    +++++
+++      +++      +++      +++      +++
+        +        +        +        +
+++      +++      +++      +++      +++
+++++    +++++    +++++    +++++    +++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++++++++++++++++++++++++++++++++++++++++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++    +++++    +++++    +++++    +++++
+++      +++      +++      +++      +++
+        +        +        +        +
+++      +++      +++      +++      +++
+++++    +++++    +++++    +++++    +++++
+++++++  +++++++  +++++++  +++++++  +++++++
+++++++++++++++++++++++++++++++++++++++++++++
```
```

I can do a triangle, or an hourglass shape,but I can't get it to repeat horizontally.

``````This is what I have up to now:

int a = 9;
char b = '+';
char c = ' ';

int i_buffer = a;
int i_leer = 1;
for( int i = 0; i < a; i++ ){

for( int z = i_buffer; z > 0; z--)
System.out.print( b );

System.out.println();

i_buffer = i_buffer - 2;
if( i_buffer < 0 )
break;

for( int z = i_leer++; z > 0; z--)
System.out.print( c );

}
```
```

Any help is appreciated