An open API service indexing awesome lists of open source software.

https://github.com/fahimfba/pattern-printing-java

Solve Any Pattern Question with This Trick! Learnt from Kunal Kushwaha.
https://github.com/fahimfba/pattern-printing-java

java pattern pattern-printing pattern-printing-programs-star structured-programming

Last synced: 6 months ago
JSON representation

Solve Any Pattern Question with This Trick! Learnt from Kunal Kushwaha.

Awesome Lists containing this project

README

          

# pattern-printing-java

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/FahimFBA/pattern-printing-java/pages%20build%20and%20deployment?style=for-the-badge)
![Total Lines of Code](https://img.shields.io/tokei/lines/github/FahimFBA/pattern-printing-java?style=for-the-badge)
![License](https://img.shields.io/github/license/FahimFBA/pattern-printing-java?style=for-the-badge)
## Note
1. Number of lines = number of rows = number times the outer loop will run
2. Identify for every row numbers, how many columns are there or types of elements in the column
3. What do you need to print
4. Try to find the formula relating rows and columns

## Patterns Covered Here (Using Java)

### Pattern 1

```
*
* *
* * *
* * * *
```
#### [Source Code](pattern01.java)

### Pattern 2

```
* * * *
* * * *
* * * *
* * * *
```
#### [Source Code](pattern02.java)

### Pattern 3
```
* * * *
* * *
* *
*
```
#### [Source Code](pattern03.java)

### Pattern 4
```
1
1 2
1 2 3
1 2 3 4
```
#### [Source Code](pattern04.java)
### Pattern 5
```
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
```
#### [Source Code](pattern05.java)

### Pattern 6
```
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
```
#### [Source Code](pattern06.java)
### Pattern 7
```
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
```
#### [Source Code](pattern07.java)

### Pattern 8
```
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
4 3 2 1 2 3 4
3 2 1 2 3
2 1 2
1
```
#### [Source Code](pattern08.java)
### Pattern 9
```
4 4 4 4 4 4 4 4 4
4 3 3 3 3 3 3 3 4
4 3 2 2 2 2 2 3 4
4 3 2 1 1 1 2 3 4
4 3 2 1 0 1 2 3 4
4 3 2 1 1 1 2 3 4
4 3 2 2 2 2 2 3 4
4 3 3 3 3 3 3 3 4
4 4 4 4 4 4 4 4 4
```
#### [Source Code](pattern09.java)