/patterns

A collection of coding patterns for beginners and learners

Primary LanguageJavaMIT LicenseMIT

Patterns

I have a dream. I have a dream that anyone in the world who is stuck in patterns will get help from this repository. Dear people of the world, please have a look at the patterns given below and write code to print that pattern after taking an input from the user. Each folder in this repository contains codes of corresponding patterns. If the patterns are not visible, use the pencil logo on the top right corner to see the patterns.

Please write code to whichever language you know and make them available for learners.

Please add more patterns if you like.

The following patterns should be printed when the user input is "5":

Q1)  
   *****  
   ****  
   ***  
   **  
   *  


Q2)  
*****  
 ****  
  ***  
   **  
    *  


Q3)  
*  
**  
***  
****  
*****  
 

Q4)  
    *  
   **  
  ***  
 ****  
*****  


Q5)  
*********  
 *******  
  *****  
   ***  
    *  


Q6)  
    *  
   ***  
  *****  
 *******  
*********  
 

Q7)  
*  
**  
***  
****  
*****  
****  
***  
**  
*  


Q8)  
    *  
   **  
  ***  
 ****  
*****  
 ****  
  ***  
   **  
    *  


Q9)  
    *  
   ***  
  *****  
   ***  
    *  


Q10)  
*****  
*   *  
*   *  
*   *  
*****  


Q11)  
    1
   1 2
  1 2 3 
 1 2 3 4
1 2 3 4 5


Q12)  
1 2 3 4 5
 1 2 3 4
  1 2 3 
   1 2
    1


Q13)  
        1
      1 2 1
    1 2 3 2 1
  1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1


Q14)
***** *****
****   ****
***     ***
**       **
*         *

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


Q15)
**********
 ********
  ******
   ****
    **
    **
   ****
  ******
 ********
**********

Q16)
*****
****
***
**
*
**
***
****
*****

Q17)
*****
** **
* * *
** **
*****

Q18)
*.*.*
.*.*.
*.*.*
.*.*.
*.*.*

Q19)
    *  *
   **  **
  ***  ***
 ****  ****
*****  *****

Q20)
*
 ***
  *****
   *******
    *********

Q21)
*   *
 * *
  *
 * *
*   *

Q22)
0 1 2 3 4
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8

Q23)
1 1 1 1 1
1 1 2 1 1
1 2 3 2 1
2 3 4 3 2
3 4 5 4 3

Q24)
 _  _
/ \/ \
\    /
 \  /
  \/

Q25)

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

Q26)

1 
1 1
1 2 1
1 2 3 1
1 2 3 4 1

Q27)

1
2 3 
4 5 6 
7 8 9 10
11 12 13 14 15
  

Project Maintainer

Profile Picture
Yash

💻