Skip to content

JS-PatternGallery: A collection of fun patterns created using JavaScript. Explore different designs and learn how to use loops and logic to make cool shapes. Great for anyone interested in coding and patterns!

License

Notifications You must be signed in to change notification settings

sagarbangade/JS-PatternGallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 JS-PatternGallery 🖥️

Welcome to JS-PatternGallery, a collection of diverse JavaScript pattern programs! Whether you're learning loops, honing your logical thinking, or just exploring visual coding, this repository offers a rich variety of shapes and patterns.


🌟 Features

  • 💻 25+ Pattern Programs: From simple triangles to complex palindromes.
  • 🔥 Interactive Examples: Each pattern is displayed alongside its source code for easy access.
  • 📂 Organized Structure: Clear, concise JavaScript implementations.
  • 🧠 Ideal for Practice: Strengthen your understanding of nested loops, conditionals, and logic.

🚀 Getting Started

To get a copy of this repository on your local machine, use the following command:

git clone https://github.com/sagarbangade/JS-PatternGallery.git

Navigate into the directory:

cd JS-PatternGallery

Open any .js file in your preferred code editor and run it in your browser's console or Node.js environment to see the pattern!

📜 How to Run 🏃‍♂️

All the pattern programs can be executed using Node.js. Clone this repository and run the JavaScript files in your terminal:

node filename.js

For example:

node pyramid_pattern.js

🧩 Patterns Collection

The table below contains visual previews of the patterns along with their corresponding file names. Click on the pattern name to view the source code.

Pattern Name Visual Example Source Code
Binary Triangle Pattern 1
10
101
1010
10101
101010
1010101
10101010
binary_triangle_pattern.js
Bricks Pattern [] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
bricks.js
Diamond Pattern *
***
*****
***
*
diamond_pattern.js
Half Diamond Pattern *
**
***
****
*****
****
***
**
*
half_diamond_pattern.js
Hollow C Pattern * * * * *
*
*
*
* * * * *
hollow_C_pattern.js
Hollow Diamond Pattern *
* *
* *
* *
* *
* *
* *
* *
*
hollow_diamond_pattern.js
Hollow N Pattern * * * * *
* *
* *
* *
* * * * *
hollow_n_pattern.js
Hollow Pyramid Pattern *
* *
* *
* *
*********
hollow_pyramid_pattern.js
Hollow Right Triangle Pattern *
**
* *
* *
*****
hollow_right_triangle_pattern.js
Hollow Square Pattern * * * * *
* *
* *
* *
* * * * *
hollow_square_pattern.js
Hollow U Pattern * *
* *
* *
* *
* * * * *
hollow_U_pattern.js
Inverted Number Pyramid 54321
4321
321
21
1
inverted_number_pyramid_pattern.js
Mirror C Pattern * * * * *
*
*
*
* * * * *
mirror_C_pattern.js
Number Palindrome Triangle 1
121
12321
1234321
123454321
number_palindrome_triangle_pattern.js
Number Pyramid Pattern 1
222
33333
4444444
555555555
number_pyramid_pattern.js
Number Rectangle 1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
number_rectangle.js
Number Square Pattern 1 2 3
4 5 6
7 8 9
number_square_pattern.js
Parallelogram Pattern *****
*****
*****
*****
*****
parallelogram_pattern.js
Pen Tree Pattern *
***
*****
*******
|
penTree.js
Pyramid Pattern *
***
*****
*******
*********
pyramid_pattern.js
Reverse Left Triangle Pattern * * * * *
* * * *
* * *
* *
*
reverse_left_triangle_pattern.js
Reverse Number Rectangle 4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
reverse_number_rectangle.js
Right Angle Triangle Pattern *
**
***
****
*****
right_angle_triangle_pattern.js
Right Triangle Using Numbers 1
12
123
1234
12345
right_triangle_pattern_using_numbers.js
W Pattern \ / \ /
\ / \ /
\ / \ /
\ / \ /
\/ \/
W_pettern.js
Zigzag Border Pattern +/\/\/\/\/\+
+\/\/\/\/\/+
+/\/\/\/\/\+
+\/\/\/\/\/+
+/\/\/\/\/\+
+\/\/\/\/\/+
+/\/\/\/\/\+
+\/\/\/\/\/+
zigzag_border_pattern.js
Z Pattern *****
*
*
*
*****
Z_pattern.js

🤝 Contributing

Contributions are welcome! If you'd like to contribute new patterns or improve existing ones, feel free to:

  1. Fork this repository.
  2. Make the changes.
  3. Submit a pull request.

📃 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Created by Sagar Eknath Bangade.
For more of my work, check out my portfolio.

About

JS-PatternGallery: A collection of fun patterns created using JavaScript. Explore different designs and learn how to use loops and logic to make cool shapes. Great for anyone interested in coding and patterns!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published