Skip to content

Commit 2415558

Browse files
Merge remote-tracking branch 'upstream/main' into feature/morse-to-text
2 parents 56c0a07 + a465352 commit 2415558

31 files changed

Lines changed: 5376 additions & 8593 deletions

.DS_Store

8 KB
Binary file not shown.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ print("\n👋 Thanks for playing!\n")
109109

110110
### ✅ Web App Projects - Structure
111111

112-
For web implementation, add to `web-app/js/projects.js`:
112+
For web implementation, add to `web-app/js/projects/your-project-name.js`:
113113

114114
```javascript
115115
// 1. HTML Template Function
@@ -137,7 +137,7 @@ function initYourProject() {
137137
});
138138
}
139139

140-
// 3. Register in getProjectHTML() and initializeProject()
140+
// 3. Register in getProjectHTML() and initializeProject() in `web-app/js/projects.js`
141141
```
142142

143143
### ✅ Web App Projects - Guidelines

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ python games/Rock-Paper-Scissor/Rock-Paper-Scissor.py
6868

6969
## 🙌 Contributors
7070

71+
- HARSHP-16
72+
73+
74+
- Quantum3600
75+
76+
77+
- abhi-nav-25
78+
79+
80+
- mrinmoyChakraborty-mrinox
81+
82+
83+
- nimkarprachi17
84+
85+
7186
- Lavanya-Talele
7287

7388

games/Number-Guessing-Game/Number-Guessing-Game.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
print("I'm thinking of a number between 1 and 100...\n")
88

99
while True:
10-
num = int(input("🤔 Guess the Number (1 - 100): "))
10+
try:
11+
num = int(input("🤔 Guess the Number (1 - 100): "))
12+
except ValueError:
13+
print("⚠️ Oops! That doesn't look like a valid number. Please try again.\n")
14+
continue
1115

1216
if (num >= 1) and (num <= 100):
1317
if num > num1:

games/Rock-Paper-Scissor/Rock-Paper-Scissor.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@
2626
computer = random.randint(1, 3)
2727

2828
if value not in valid:
29-
Flag = False
30-
print('❌ Invalid choice! Rerun the game...\n')
31-
32-
elif Flag:
33-
print(f'\n👤 You chose: {key[valid[value]]}')
34-
print(f'🤖 Computer chose: {key[computer]}\n')
35-
36-
if (valid[value] == 1 and computer == 2) or (valid[value] == 2 and computer == 3) or (valid[value] == 3 and computer == 1):
37-
print('😢 You lost!! Better luck next time!\n')
38-
elif valid[value] == computer:
39-
print("🤝 It's a Tie!! Great minds think alike!\n")
40-
else:
41-
print('🎉 You won!! Congratulations!\n')
29+
print('❌ Invalid choice! Please enter r, p, or s. Try again.\n')
30+
continue
31+
32+
print(f'\n👤 You chose: {key[valid[value]]}')
33+
print(f'🤖 Computer chose: {key[computer]}\n')
34+
35+
if (valid[value] == 1 and computer == 2) or (valid[value] == 2 and computer == 3) or (valid[value] == 3 and computer == 1):
36+
print('😢 You lost!! Better luck next time!\n')
37+
elif valid[value] == computer:
38+
print("🤝 It's a Tie!! Great minds think alike!\n")
39+
else:
40+
print('🎉 You won!! Congratulations!\n')
4241

4342
response = str(input('Continue playing? Yes(y) or No(n): ')).lower()
4443

math/Happy-Number/Happy-Number.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
print("🔢 Happy Number Checker 🔢")
22
print("🎯 A happy number is a number which eventually reaches 1 when replaced repeatedly by the sum of the square of its digits.\n")
33

4-
N = int(input("➡️ Enter a number: "))
4+
while True:
5+
try:
6+
N = int(input("➡️ Enter a number: "))
7+
break
8+
except ValueError:
9+
print("⚠️ Oops! That doesn't look like a valid number. Please try again.\n")
510

611
seen = set()
712
num = N
@@ -12,4 +17,4 @@
1217
if (num == 1):
1318
print(f"🔍 {N} is a happy number! ✅")
1419
else:
15-
print(f"🔍 {N} is not a happy number. ❌")
20+
print(f"🔍 {N} is not a happy number. ❌")

math/Pascal-Triangle/Pascal-Triangle.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,21 @@
3232
print(f"Row {i+1}: {row_str.center(max_width)}")
3333

3434
elif choice == '2':
35-
row_num = int(input(f"\n📍 Enter row number (1 to {n}): "))
36-
37-
if 1 <= row_num <= len(triangle):
35+
try:
36+
row_num = int(input(f"\n📍 Enter row number (1 to {n}): "))
37+
except ValueError:
38+
print("⚠️ Oops! That doesn't look like a valid number. Please try again.")
39+
row_num = None
40+
41+
if row_num is not None and 1 <= row_num <= len(triangle):
3842
print(f"\n📍 Row {row_num} of Pascal's Triangle:")
3943
print(f" {triangle[row_num-1]}")
4044
print(f"\n📊 Elements: {' → '.join(map(str, triangle[row_num-1]))}")
41-
else:
45+
elif row_num is not None:
4246
print(f"\n❌ Row {row_num} doesn't exist in the generated triangle!")
43-
44-
else:
45-
print("❌ Invalid choice!")
47+
48+
else:
49+
print("❌ Invalid choice!")
4650

4751
print(f"\n💡 Total rows generated: {n}")
4852

utilities/Productivity-Pet/Productivity-Pet.py

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,60 @@
77
user = input("➡️ Did you complete your tasks today? (yes/no): ").lower().strip()
88

99
if user in ["yes", "yeah", "yep"]:
10+
while True:
11+
count = input("📝 How many tasks were in your list? ").strip()
1012

11-
count = input("📝 How many tasks were in your list? ").strip()
13+
if not count.isdigit() or int(count) <= 0:
14+
print("⚠️ Please enter a valid number.\n")
15+
continue
1216

13-
if not count.isdigit() or int(count) <= 0:
14-
print("⚠️ Please enter a valid number.\n")
15-
continue
17+
count = int(count)
18+
tasks = []
19+
for i in range(count):
1620

17-
count = int(count)
18-
tasks = []
19-
for i in range(count):
20-
task = input(f" Task {i+1}: ")
21-
tasks.append(task)
21+
while True:
22+
task = input(f" Task {i+1}: ").strip()
2223

23-
done = input("✅ How many did you complete? ").strip()
24+
if not task:
25+
print("⚠️ Task name cannot be empty.")
26+
continue
2427

25-
if not done.isdigit():
26-
print("⚠️ Please enter a valid number.\n")
27-
continue
28+
tasks.append(task)
29+
break
30+
31+
while True:
2832

29-
done = int(done)
33+
done = input("✅ How many did you complete? ").strip()
3034

31-
if done < 0 or done > count:
32-
print("⚠️ That doesn't seem right. Try again.\n")
33-
continue
35+
if not done.isdigit():
36+
print("⚠️ Please enter a valid number.\n")
37+
continue
3438

35-
percentage = (done / count) * 100
36-
print(f"\n📊 Progress: {percentage:.1f}%")
39+
done = int(done)
3740

38-
pets = ["🐦", "🐧", "🦇", "🦤", "🦆", "🦅"]
39-
pet = random.choice(pets)
41+
if done < 0 or done > count:
42+
print("⚠️ That doesn't seem right. Try again.\n")
43+
continue
4044

41-
if percentage < 50:
42-
print("😔 The pet didn't hatch. Current stage: 🥚")
43-
print("💡 Try completing more tasks tomorrow!\n")
44-
elif percentage < 80:
45-
print("🐣 Getting there! Current stage: 🐣")
46-
print("💪 Almost hatched — keep going!\n")
47-
else:
48-
print(f"🎉 Congratulations! Your pet hatched: {pet}")
49-
print("🏆 Amazing work today!\n")
45+
break
46+
47+
percentage = (done / count) * 100
48+
print(f"\n📊 Progress: {percentage:.1f}%")
49+
50+
pets = ["🐦", "🐧", "🦇", "🦤", "🦆", "🦅"]
51+
pet = random.choice(pets)
52+
53+
if percentage < 50:
54+
print("😔 The pet didn't hatch. Current stage: 🥚")
55+
print("💡 Try completing more tasks tomorrow!\n")
56+
elif percentage < 80:
57+
print("🐣 Getting there! Current stage: 🐣")
58+
print("💪 Almost hatched — keep going!\n")
59+
else:
60+
print(f"🎉 Congratulations! Your pet hatched: {pet}")
61+
print("🏆 Amazing work today!\n")
62+
63+
break
5064

5165
elif user in ["no", "nope", "nah"]:
5266
print("💬 No worries! Come back when you're done.\n")

web-app/.DS_Store

8 KB
Binary file not shown.

web-app/assets/games-bg.jpg

144 KB
Loading

0 commit comments

Comments
 (0)