Skip to content

Commit 96990cd

Browse files
committed
2 parents 21a8e7c + 6d4f11e commit 96990cd

16 files changed

Lines changed: 2081 additions & 195 deletions

File tree

.github/workflows/contributors.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: contributor automation
2+
3+
on:
4+
schedule: # runs daily at midnight
5+
- cron: '0 0 * * *'
6+
pull_request:
7+
types: [closed]
8+
branches:
9+
- main
10+
11+
# allows manual trigger
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
update-readme:
17+
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Fetch Merged PR Authors (Pagination)
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
set -euo pipefail
28+
PAGE=1
29+
echo "[]" > final_list.json
30+
while true; do
31+
# Using pulls endpoint to capture only merged contributors
32+
RESPONSE=$(gh api "/repos/steam-bell-92/python-mini-project/pulls?state=closed&per_page=100&page=${PAGE}")
33+
COUNT=$(echo "$RESPONSE" | jq '. | length')
34+
if [ "$COUNT" -eq 0 ]; then break; fi
35+
jq -s '.[0] + .[1]' final_list.json <(echo "$RESPONSE") > tmp.json && mv tmp.json final_list.json
36+
PAGE=$((PAGE + 1))
37+
done
38+
# Filters for actual merged PRs and unique users
39+
jq '[.[]
40+
| select(.merged_at != null and .user != null and .user.type != "Bot")
41+
| .user.login]
42+
| unique
43+
| sort' final_list.json > contributors.json
44+
- name: Build Gallery HTML
45+
run: |
46+
set -euo pipefail
47+
GALLERY_HTML=""
48+
for USERNAME in $(jq -r '.[]' contributors.json); do
49+
GALLERY_HTML="${GALLERY_HTML}<a href=\"https://github.com/${USERNAME}\"><img src=\"https://github.com/${USERNAME}.png\" width=\"50px\" loading=\"lazy\" title=\"${USERNAME}\" style=\"border-radius:50%;margin:5px;\" alt=\"${USERNAME}\" /></a>"
50+
done
51+
echo "$GALLERY_HTML" > gallery_fragment.txt
52+
53+
- name: Update README.md
54+
run: |
55+
set -euo pipefail
56+
# Safety check for markers
57+
start_count=$(grep -c '<!-- CONTRIBUTORS_START -->' README.md || true)
58+
end_count=$(grep -c '<!-- CONTRIBUTORS_END -->' README.md || true)
59+
if [ "$start_count" -ne 1 ] || [ "$end_count" -ne 1 ]; then
60+
echo "Error: README.md must contain exactly one pair of markers."
61+
exit 1
62+
fi
63+
64+
start_line=$(grep -n '<!-- CONTRIBUTORS_START -->' README.md | cut -d: -f1)
65+
end_line=$(grep -n '<!-- CONTRIBUTORS_END -->' README.md | cut -d: -f1)
66+
if [ "$start_line" -ge "$end_line" ]; then
67+
echo "Error: CONTRIBUTORS_START must appear before CONTRIBUTORS_END."
68+
exit 1
69+
fi
70+
71+
sed -i '/<!-- CONTRIBUTORS_START -->/,/<!-- CONTRIBUTORS_END -->/ {
72+
/<!-- CONTRIBUTORS_START -->/! { /<!-- CONTRIBUTORS_END -->/! d; }
73+
}' README.md
74+
sed -i '/<!-- CONTRIBUTORS_START -->/r gallery_fragment.txt' README.md
75+
76+
- name: Commit and Push
77+
run: |
78+
git config --global user.name "github-actions[bot]"
79+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
80+
git add README.md
81+
if git diff --staged --quiet; then
82+
echo "No changes to README."
83+
else
84+
git commit -m "docs: update contributor gallery"
85+
git push
86+
fi

CONTRIBUTING.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ git push origin feature/your-project-name
7070
# Go to GitHub and create a Pull Request
7171
```
7272

73+
7374
---
7475

7576
## 📋 Project Guidelines
@@ -336,6 +337,115 @@ New to contributing? Check these out:
336337
- [Emoji Cheat Sheet](https://github.com/ikatyang/emoji-cheat-sheet)
337338

338339
---
340+
## Issue Difficulty Levels
341+
342+
To make contributing easier for everyone, we use difficulty labels for issues.
343+
These labels help contributors understand how much experience or effort an issue may require before getting started.
344+
345+
---
346+
347+
### level: Beginner
348+
349+
Good for first-time contributors or people who are still learning the project structure.
350+
351+
#### What to Expect
352+
- Small and simple changes
353+
- Easy to understand
354+
- Usually does not require deep project knowledge
355+
356+
#### Criteria
357+
- Minor bug fixes
358+
- Simple documentation updates
359+
- Small UI/text changes
360+
- Basic code cleanup
361+
362+
#### Example Issues
363+
- Fix spelling mistakes in documentation
364+
- Improve README formatting
365+
- Rename variables for better readability
366+
- Add comments to simple functions
367+
- Update broken links
368+
369+
---
370+
371+
### level: Intermediate
372+
373+
Best for contributors who are comfortable reading and understanding the codebase.
374+
375+
#### What to Expect
376+
- Moderate coding tasks
377+
- Requires understanding of project flow
378+
- May involve working across multiple files
379+
380+
#### Criteria
381+
- Feature improvements
382+
- Refactoring existing code
383+
- Writing tests
384+
- Fixing medium-level bugs
385+
386+
#### Example Issues
387+
- Add validation to forms or APIs
388+
- Improve performance of an existing feature
389+
- Write unit tests for modules
390+
- Refactor repeated code into reusable functions
391+
- Improve error handling
392+
393+
---
394+
395+
### level: Advanced
396+
397+
Recommended for experienced contributors who understand the architecture of the project.
398+
399+
#### What to Expect
400+
- Complex tasks
401+
- Requires strong debugging and problem-solving skills
402+
- May involve major feature development or architectural changes
403+
404+
#### Criteria
405+
- Large feature implementations
406+
- System design changes
407+
- Complex bug fixes
408+
- Multi-module updates
409+
410+
#### Example Issues
411+
- Design and implement a new module
412+
- Optimize database or backend architecture
413+
- Handle complex state management
414+
- Integrate third-party services
415+
- Major performance optimization tasks
416+
417+
---
418+
419+
### level: Critical
420+
421+
For high-priority or highly sensitive tasks that may impact important parts of the project.
422+
423+
#### What to Expect
424+
- Requires strong technical understanding
425+
- May affect security, stability, or core functionality
426+
- Needs careful testing and review
427+
428+
#### Criteria
429+
- Security-related fixes
430+
- Critical production bugs
431+
- Core architecture updates
432+
- High-impact system improvements
433+
434+
#### Example Issues
435+
- Fix authentication vulnerabilities
436+
- Resolve major backend crashes
437+
- Improve core system reliability
438+
- Handle critical deployment issues
439+
- Refactor sensitive infrastructure code
440+
441+
---
442+
443+
## Recommendation for New Contributors
444+
445+
If you are contributing for the first time, we strongly recommend starting with **level: Beginner** issues.
446+
These tasks are beginner-friendly and help you understand the project structure, contribution workflow, and coding style before moving to more advanced issues.
447+
448+
Once you feel comfortable, you can gradually try `level:intermediate`, `level:advanced`, and `level:critical` tasks.
339449

340450
## 🤔 Questions?
341451

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ Test your memory with an ever-growing sequence!
229229
python games/Simon-Says/Simon-Says.py
230230
```
231231

232+
</td>
233+
<td width="50%">
234+
235+
#### 🔍 Spot the Difference
236+
Find all the hidden differences between two interactive canvases!
237+
- 🎨 Programmatically drawn dynamic scenes
238+
- 🌟 Three distinct difficulty levels
239+
- ⏱️ Built-in timer and hint system
240+
- 🌐 *Web App Exclusive Project*
241+
232242
</td>
233243
</tr>
234244
</table>
@@ -524,7 +534,13 @@ We love contributions! Here's how you can help:
524534
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
525535

526536
---
537+
## Contributors
527538

539+
<!-- CONTRIBUTORS_START -->
540+
<a href="https://github.com/Aayuiiitmg"><img src="https://github.com/Aayuiiitmg.png" width="50px" style="border-radius:50%;margin:5px;" alt="Aayuiiitmg" /></a><a href="https://github.com/Arpitawork24"><img src="https://github.com/Arpitawork24.png" width="50px" style="border-radius:50%;margin:5px;" alt="Arpitawork24" /></a><a href="https://github.com/Bhairavi-28"><img src="https://github.com/Bhairavi-28.png" width="50px" style="border-radius:50%;margin:5px;" alt="Bhairavi-28" /></a><a href="https://github.com/C4aZy"><img src="https://github.com/C4aZy.png" width="50px" style="border-radius:50%;margin:5px;" alt="C4aZy" /></a><a href="https://github.com/Diksha57-git"><img src="https://github.com/Diksha57-git.png" width="50px" style="border-radius:50%;margin:5px;" alt="Diksha57-git" /></a><a href="https://github.com/Facelessism"><img src="https://github.com/Facelessism.png" width="50px" style="border-radius:50%;margin:5px;" alt="Facelessism" /></a><a href="https://github.com/Indrayani11-15"><img src="https://github.com/Indrayani11-15.png" width="50px" style="border-radius:50%;margin:5px;" alt="Indrayani11-15" /></a><a href="https://github.com/Juhi4433"><img src="https://github.com/Juhi4433.png" width="50px" style="border-radius:50%;margin:5px;" alt="Juhi4433" /></a><a href="https://github.com/Kartikeyji17"><img src="https://github.com/Kartikeyji17.png" width="50px" style="border-radius:50%;margin:5px;" alt="Kartikeyji17" /></a><a href="https://github.com/KhushiVadadoriya"><img src="https://github.com/KhushiVadadoriya.png" width="50px" style="border-radius:50%;margin:5px;" alt="KhushiVadadoriya" /></a><a href="https://github.com/Kunal241207"><img src="https://github.com/Kunal241207.png" width="50px" style="border-radius:50%;margin:5px;" alt="Kunal241207" /></a><a href="https://github.com/Mounika-39"><img src="https://github.com/Mounika-39.png" width="50px" style="border-radius:50%;margin:5px;" alt="Mounika-39" /></a><a href="https://github.com/Naveen-Boddepalli"><img src="https://github.com/Naveen-Boddepalli.png" width="50px" style="border-radius:50%;margin:5px;" alt="Naveen-Boddepalli" /></a><a href="https://github.com/PRODHOSH"><img src="https://github.com/PRODHOSH.png" width="50px" style="border-radius:50%;margin:5px;" alt="PRODHOSH" /></a><a href="https://github.com/SANDHIYAPRIYADHARSHINI"><img src="https://github.com/SANDHIYAPRIYADHARSHINI.png" width="50px" style="border-radius:50%;margin:5px;" alt="SANDHIYAPRIYADHARSHINI" /></a><a href="https://github.com/Sanjhivvarshan-b-s"><img src="https://github.com/Sanjhivvarshan-b-s.png" width="50px" style="border-radius:50%;margin:5px;" alt="Sanjhivvarshan-b-s" /></a><a href="https://github.com/Sreekuttan-007"><img src="https://github.com/Sreekuttan-007.png" width="50px" style="border-radius:50%;margin:5px;" alt="Sreekuttan-007" /></a><a href="https://github.com/TheBinaryAVA"><img src="https://github.com/TheBinaryAVA.png" width="50px" style="border-radius:50%;margin:5px;" alt="TheBinaryAVA" /></a><a href="https://github.com/Tiago-Vier-Preto"><img src="https://github.com/Tiago-Vier-Preto.png" width="50px" style="border-radius:50%;margin:5px;" alt="Tiago-Vier-Preto" /></a><a href="https://github.com/ayushyadav0707"><img src="https://github.com/ayushyadav0707.png" width="50px" style="border-radius:50%;margin:5px;" alt="ayushyadav0707" /></a><a href="https://github.com/codewithakshyaaa"><img src="https://github.com/codewithakshyaaa.png" width="50px" style="border-radius:50%;margin:5px;" alt="codewithakshyaaa" /></a><a href="https://github.com/gatiksolanki13-netizen"><img src="https://github.com/gatiksolanki13-netizen.png" width="50px" style="border-radius:50%;margin:5px;" alt="gatiksolanki13-netizen" /></a><a href="https://github.com/iamprasoon2006-cell"><img src="https://github.com/iamprasoon2006-cell.png" width="50px" style="border-radius:50%;margin:5px;" alt="iamprasoon2006-cell" /></a><a href="https://github.com/jyotish6699"><img src="https://github.com/jyotish6699.png" width="50px" style="border-radius:50%;margin:5px;" alt="jyotish6699" /></a><a href="https://github.com/kumudasrip"><img src="https://github.com/kumudasrip.png" width="50px" style="border-radius:50%;margin:5px;" alt="kumudasrip" /></a><a href="https://github.com/madhavcodes25"><img src="https://github.com/madhavcodes25.png" width="50px" style="border-radius:50%;margin:5px;" alt="madhavcodes25" /></a><a href="https://github.com/mahi-8758"><img src="https://github.com/mahi-8758.png" width="50px" style="border-radius:50%;margin:5px;" alt="mahi-8758" /></a><a href="https://github.com/nene-hana"><img src="https://github.com/nene-hana.png" width="50px" style="border-radius:50%;margin:5px;" alt="nene-hana" /></a><a href="https://github.com/nishtha-agarwal-211"><img src="https://github.com/nishtha-agarwal-211.png" width="50px" style="border-radius:50%;margin:5px;" alt="nishtha-agarwal-211" /></a><a href="https://github.com/parasmani-dev"><img src="https://github.com/parasmani-dev.png" width="50px" style="border-radius:50%;margin:5px;" alt="parasmani-dev" /></a><a href="https://github.com/sanzzzz-g"><img src="https://github.com/sanzzzz-g.png" width="50px" style="border-radius:50%;margin:5px;" alt="sanzzzz-g" /></a><a href="https://github.com/ssuyashhhh"><img src="https://github.com/ssuyashhhh.png" width="50px" style="border-radius:50%;margin:5px;" alt="ssuyashhhh" /></a>
541+
<!-- CONTRIBUTORS_END -->
542+
543+
---
528544
## 📝 License
529545

530546
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -552,4 +568,4 @@ Found this helpful? Show some love!
552568

553569
[⬆ Back to Top](#-python-mini-projects-collection-)
554570

555-
</div>
571+
</div>
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import random
2+
import string
3+
4+
MAX_ATTEMPTS = 8
5+
6+
WORDS = [ "karate", "judo", "taekwondo", "aikido", "kungfu", "muaythai", "capoeira", "boxing", "python", "javascript", "algorithm", "compiler", "debugger", "recursion", "variable", "function", "database", "network", "kernel", "encryption", "github", "docker", "linux", "server", "cloud", "runtime", "binary", "pointer", "thread", "naruto", "sasuke", "goku", "luffy", "zoro", "gojo", "tanjiro", "levi", "eren", "light", "lelouch", "pikachu" ]
7+
8+
WORDS_BY_LENGTH = {}
9+
10+
for word in WORDS:
11+
length = len(word)
12+
if length not in WORDS_BY_LENGTH:
13+
WORDS_BY_LENGTH[length] = []
14+
WORDS_BY_LENGTH[length].append(word)
15+
16+
17+
def display_intro():
18+
print("REVERSE HANGMAN")
19+
print("=" * 40)
20+
print("The computer will try to guess your word.")
21+
print("Choose any valid word from the dictionary.")
22+
print("The AI uses elimination logic and letter frequency.\n")
23+
24+
25+
def get_secret_word():
26+
while True:
27+
word = input("Enter your secret word: ").lower().strip()
28+
if not word.isalpha():
29+
print("Invalid input. Please enter letters only.")
30+
continue
31+
if word not in WORDS:
32+
print("Word not found in the dictionary.")
33+
continue
34+
return word
35+
36+
37+
def get_possible_words(pattern, guessed_letters, wrong_letters):
38+
possible_words = []
39+
40+
for word in WORDS_BY_LENGTH[len(pattern)]:
41+
valid = True
42+
for i in range(len(word)):
43+
if pattern[i] != "_" and word[i] != pattern[i]:
44+
valid = False
45+
break
46+
47+
if pattern[i] == "_" and word[i] in guessed_letters:
48+
valid = False
49+
break
50+
if valid:
51+
for letter in wrong_letters:
52+
if letter in word:
53+
valid = False
54+
break
55+
if valid:
56+
possible_words.append(word)
57+
return possible_words
58+
59+
def choose_best_letter(possible_words, guessed_letters):
60+
frequency = {}
61+
62+
for word in possible_words:
63+
for letter in set(word):
64+
if letter not in guessed_letters:
65+
frequency[letter] = frequency.get(letter, 0) + 1
66+
if not frequency:
67+
remaining = [c for c in string.ascii_lowercase if c not in guessed_letters]
68+
return random.choice(remaining)
69+
return max(frequency, key=frequency.get)
70+
71+
72+
def update_pattern(secret_word, pattern, guess):
73+
pattern = list(pattern)
74+
for i in range(len(secret_word)):
75+
if secret_word[i] == guess:
76+
pattern[i] = guess
77+
return "".join(pattern)
78+
79+
80+
def play_game():
81+
print("\nREVERSE HANGMAN STARTED!!!\n")
82+
secret_word = get_secret_word()
83+
pattern = "_" * len(secret_word)
84+
guessed_letters = set()
85+
wrong_letters = set()
86+
attempts_left = MAX_ATTEMPTS
87+
print("Analyzing the word...\n")
88+
89+
while attempts_left > 0 and "_" in pattern:
90+
possible_words = get_possible_words(pattern, guessed_letters, wrong_letters)
91+
guess = choose_best_letter(possible_words, guessed_letters)
92+
guessed_letters.add(guess)
93+
print("Computer guesses:", guess)
94+
95+
if guess in secret_word:
96+
print("Correct guess")
97+
pattern = update_pattern(secret_word, pattern, guess)
98+
else:
99+
print("Wrong guess")
100+
wrong_letters.add(guess)
101+
attempts_left -= 1
102+
print("Current word:", " ".join(pattern))
103+
print("Attempts left:", attempts_left)
104+
print("\n")
105+
106+
if "_" not in pattern:
107+
print("Computer successfully guessed your word!!!")
108+
else:
109+
print("Computer failed to guess the word.")
110+
print("Your secret word was:", secret_word)
111+
112+
113+
while True:
114+
play_game()
115+
choice = input("Wanna play again? (y/n): ").lower().strip()
116+
if choice != "y":
117+
print("Thanks for playing Reverse Hangman!")
118+
break

games/Snake-Game/Snake-Game.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,18 @@ def move():
114114
)
115115

116116
if head.distance(food) < 15:
117-
x = random.randint(-14, 14) * 20
118-
y = random.randint(-14, 14) * 20
117+
while True:
118+
x = random.randint(-14, 14) * 20
119+
y = random.randint(-14, 14) * 20
120+
overlaps = False
121+
if head.distance(x, y) < 15:
122+
overlaps = True
123+
for p in parts:
124+
if p.distance(x, y) < 15:
125+
overlaps = True
126+
break
127+
if not overlaps:
128+
break
119129

120130
food.goto(x, y)
121131

0 commit comments

Comments
 (0)