Skip to content

Commit 2487d66

Browse files
authored
Merge pull request sumanth-0#704 from DevNexis/main
Add Origami Instructions Guide - Fixes sumanth-0#615
2 parents 8b9cc91 + 0e3b6c3 commit 2487d66

File tree

2 files changed

+195
-0
lines changed

2 files changed

+195
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Origami Instructions Guide
2+
3+
A Python script that provides step-by-step origami folding instructions from a preset selection of classic designs.
4+
5+
## Description
6+
7+
This interactive command-line program guides users through the art of origami (paper folding) with detailed step-by-step instructions. The script includes four popular origami designs with varying difficulty levels, making it perfect for beginners and intermediate folders alike.
8+
9+
## Features
10+
11+
- **4 Origami Designs**: Traditional Crane, Paper Boat, Jumping Frog, and Simple Butterfly
12+
- **Difficulty Levels**: Each design is labeled with its difficulty level (Easy or Intermediate)
13+
- **Interactive Instructions**: Step-by-step guidance with the ability to advance at your own pace
14+
- **User-Friendly Menu**: Easy-to-navigate menu system for selecting designs
15+
- **Exactly 100 Lines**: Adheres to the repository's 100-line code requirement
16+
17+
## Available Designs
18+
19+
1. **Traditional Crane** (Intermediate)
20+
- The iconic Japanese origami design
21+
- 12 detailed steps
22+
23+
2. **Paper Boat** (Easy)
24+
- A classic childhood favorite
25+
- 10 easy-to-follow steps
26+
27+
3. **Jumping Frog** (Easy)
28+
- A fun interactive origami that actually jumps!
29+
- 10 steps with a playful result
30+
31+
4. **Simple Butterfly** (Easy)
32+
- A beautiful and quick design
33+
- 8 simple steps
34+
35+
## Requirements
36+
37+
- Python 3.x
38+
- No external dependencies required
39+
40+
## Usage
41+
42+
Run the script using Python:
43+
44+
```bash
45+
python origami_instructions_guide.py
46+
```
47+
48+
Follow the on-screen menu:
49+
1. Select a design by entering its number (1-4)
50+
2. Press Enter to advance through each step
51+
3. Follow the instructions carefully
52+
4. Enter 0 to exit the program
53+
54+
## Example
55+
56+
```
57+
=== ORIGAMI INSTRUCTIONS GUIDE ===
58+
59+
Available Origami Designs:
60+
1. Traditional Crane - Difficulty: Intermediate
61+
2. Paper Boat - Difficulty: Easy
62+
3. Jumping Frog - Difficulty: Easy
63+
4. Simple Butterfly - Difficulty: Easy
64+
0. Exit
65+
66+
Select an origami design (0-4): 2
67+
68+
==================================================
69+
PAPER BOAT
70+
Difficulty Level: Easy
71+
==================================================
72+
73+
Step 1: Start with a rectangular piece of paper
74+
75+
Press Enter for next step...
76+
```
77+
78+
## Tips for Success
79+
80+
- Use square paper for best results (except the boat which uses rectangular paper)
81+
- Make crisp, sharp folds
82+
- Take your time with each step
83+
- Practice makes perfect!
84+
85+
## Contributing
86+
87+
This project is part of the 100LinesOfPythonCode repository. Contributions and improvements are welcome!
88+
89+
## Issue Reference
90+
91+
This implementation addresses issue #615: Make Origami Instructions Guide
92+
93+
## License
94+
95+
This project is open source and available under the repository's license terms.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env python3
2+
"""Origami Instructions Guide - Step-by-step folding instructions from preset selection"""
3+
4+
origami_library = {
5+
"1": {
6+
"name": "Traditional Crane",
7+
"difficulty": "Intermediate",
8+
"steps": [
9+
"Start with a square piece of paper, colored side down",
10+
"Fold in half diagonally both ways, then unfold",
11+
"Fold in half horizontally both ways, then unfold",
12+
"Bring the top three corners down to the bottom corner (waterbomb base)",
13+
"Fold the top triangular flaps into the center",
14+
"Fold the top down over the flaps",
15+
"Unfold the last two steps",
16+
"Petal fold: Lift the first layer up and fold the sides inward",
17+
"Flip and repeat the petal fold on the other side",
18+
"Fold both flaps up to create the legs",
19+
"Inside reverse fold one leg to make the head",
20+
"Fold down the wings and your crane is complete!"
21+
]
22+
},
23+
"2": {
24+
"name": "Paper Boat",
25+
"difficulty": "Easy",
26+
"steps": [
27+
"Start with a rectangular piece of paper",
28+
"Fold the paper in half lengthwise",
29+
"Fold in half widthwise, then unfold",
30+
"Fold the top corners down to the center crease",
31+
"Fold the bottom edge up on both sides",
32+
"Open from the bottom and flatten into a square",
33+
"Fold the bottom corners up on both sides",
34+
"Open from the bottom and flatten again",
35+
"Gently pull the top corners apart",
36+
"Your boat is ready to sail!"
37+
]
38+
},
39+
"3": {
40+
"name": "Jumping Frog",
41+
"difficulty": "Easy",
42+
"steps": [
43+
"Start with a square piece of paper",
44+
"Fold in half lengthwise, then unfold",
45+
"Fold the top corners down to the center line",
46+
"Fold the angled sides to the center",
47+
"Fold the bottom edge up to the base of the triangle",
48+
"Fold the bottom corners up and out",
49+
"Fold the bottom edge up again",
50+
"Fold in half, bringing the bottom to the back",
51+
"Fold the back layer down to create a step",
52+
"Press on the frog's back to make it jump!"
53+
]
54+
},
55+
"4": {
56+
"name": "Simple Butterfly",
57+
"difficulty": "Easy",
58+
"steps": [
59+
"Start with a square piece of paper, colored side down",
60+
"Fold in half diagonally, then unfold",
61+
"Fold in half diagonally the other way",
62+
"Fold the top corner down to the bottom corner",
63+
"Fold a small triangle at the top down",
64+
"Flip the paper over",
65+
"Fold in half vertically, bringing the wings together",
66+
"Your butterfly is complete!"
67+
]
68+
}
69+
}
70+
71+
def display_menu():
72+
print("\n=== ORIGAMI INSTRUCTIONS GUIDE ===")
73+
print("\nAvailable Origami Designs:")
74+
for key, origami in origami_library.items():
75+
print(f"{key}. {origami['name']} - Difficulty: {origami['difficulty']}")
76+
print("0. Exit")
77+
78+
def display_instructions(origami_data):
79+
print(f"\n{'='*50}")
80+
print(f"{origami_data['name'].upper()}")
81+
print(f"Difficulty Level: {origami_data['difficulty']}")
82+
print(f"{'='*50}\n")
83+
for i, step in enumerate(origami_data['steps'], 1):
84+
print(f"Step {i}: {step}")
85+
input("\nPress Enter for next step..." if i < len(origami_data['steps']) else "\nPress Enter to return to menu...")
86+
87+
def main():
88+
while True:
89+
display_menu()
90+
choice = input("\nSelect an origami design (0-4): ").strip()
91+
if choice == "0":
92+
print("\nHappy folding! Goodbye!")
93+
break
94+
elif choice in origami_library:
95+
display_instructions(origami_library[choice])
96+
else:
97+
print("\nInvalid choice. Please try again.")
98+
99+
if __name__ == "__main__":
100+
main()

0 commit comments

Comments
 (0)