Monday, August 27, 2012

Playing with Asterisk patterns-6

Java code for getting the following patterns:
Method receives String array with input String XYZ combinations and an integer varaible for the size of the String to be displayed.

X,Y,Z size=3

* *
 *
* *

* *
 *
 *

***
  *
*
***
XYZ, size=7

*   *
 * *
  *
 * *
*   *
*   *
 * *
  *
  *
  *
*****
  *
 *
*
*****

XYZ, Size=9

*      *
 *   *
  * *
   *
  * *
 *   *
*     *
*      *
 *   *
  * *
   *
   *
   *
   *
*******
    *
   *
  *
 *
*******
Java code:




Thursday, August 23, 2012

Playing with Asterisk patterns-5

Java code for generating the following pattern:

            *
           * *
          * * *
         * * * *
        * * * * *
       * * * * * *
      * * * * * * *
     * * * * * * * *
    * * * * * * * * *
   * * * * * * * * * *

Playing with Asterisk patterns-4

Java code for generating the following pattern :

      *
     **
    ***
   ****
  *****
 ******
 ******
  *****
   ****
    ***
     **
      *

Playing with Asterisk patterns-3

Java code for generating the following pattern:

      *
     **
    ***
   ****
  *****
 ******

Playing with Asterisk patterns-2

Java Code for generating the following pattern:
*
 * *
  *  *  *
   *   *   *   *
    *    *    *    *    *
     *     *     *     *     *     *

Playing with Asterisk patterns-1

Java Code for generating the following "*" patterns.

*
**
***
****
*****
******
******
*****
****
***
**
*