Skip to content

Added new project #6

Open
Unknown27s wants to merge 11 commits intoRitesh-456:mainfrom
Unknown27s:main
Open

Added new project #6
Unknown27s wants to merge 11 commits intoRitesh-456:mainfrom
Unknown27s:main

Conversation

@Unknown27s
Copy link
Copy Markdown
Contributor

Easy
Hangman.py
Medium
Todo_List_Manager.py
Chess_Game.py
Hard
Discord_Bot.py
Discord_Bot_requirements.txt
Machine_Learning_Image_Classifier.py
Expert
Reinforcement_Learning_Game_Agent

Copilot AI review requested due to automatic review settings January 31, 2026 13:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds six new Python project examples to the repository across different difficulty levels. The projects range from a simple Hangman game to advanced reinforcement learning and machine learning implementations. The README has been updated to include descriptions of all new projects, and the difficulty level "Expert" has been added.

Changes:

  • Added "Expert" difficulty tier to the project collection
  • Added 6 new project implementations: Hangman, Todo List Manager, Chess Game, Discord Bot, Machine Learning Image Classifier, and Reinforcement Learning Game Agent
  • Renumbered existing projects in README to accommodate new additions

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 26 comments.

Show a summary per file
File Description
Readme.md Updated to include new Expert tier, added descriptions for 6 new projects, renumbered existing projects
Easy/26_Hangman.py Word guessing game with ASCII art hangman display
Medium/19_Todo_List_Manager.py Command-line task manager with JSON persistence
Medium/20_Chess_Game.py Two-player chess implementation with move validation
Medium/todo_list.json Sample data file for todo list manager
Hard/25_Discord_Bot.py Feature-rich Discord bot with multiple commands
Hard/25_Discord_Bot_requirements.txt Dependencies for Discord bot
Hard/26_Machine_Learning_Image_Classifier.py CNN for MNIST digit classification
Hard/26_Machine_Learning_Image_Classifier_requirements.txt Dependencies for ML classifier
Expert/26_Reinforcement_Learning_Game_Agent/main.py Entry point for RL tic-tac-toe agent
Expert/26_Reinforcement_Learning_Game_Agent/game.py Tic-tac-toe game logic
Expert/26_Reinforcement_Learning_Game_Agent/agent.py Q-learning agent implementation
Expert/26_Reinforcement_Learning_Game_Agent/requirements.txt Dependencies for RL agent

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Readme.md Outdated
Comment on lines +94 to +101
game.print_board()

next_state, reward, done = game.make_move(action)
state = next_state

if not done:
print("\nYour turn:")
game.print_board()
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent always plays first (as X) and the human always plays second (as O), but the game logic doesn't enforce turn order properly in the play method. If the agent wins on its first move or if there's any edge case, the human might not get a turn even though the message says "You go second." Consider checking if the game is over before prompting for human input.

Suggested change
game.print_board()
next_state, reward, done = game.make_move(action)
state = next_state
if not done:
print("\nYour turn:")
game.print_board()
next_state, reward, done = game.make_move(action)
state = next_state
game.print_board()
if not done:
print("\nYour turn:")

Copilot uses AI. Check for mistakes.
Comment thread Expert/26_Reinforcement_Learning_Game_Agent/agent.py Outdated
Comment thread Medium/20_Chess_Game.py
Comment on lines +33 to +64
def is_valid_move(self, start, end):
start_row, start_col = self.algebraic_to_coords(start)
end_row, end_col = self.algebraic_to_coords(end)

if not (0 <= start_row < 8 and 0 <= start_col < 8 and 0 <= end_row < 8 and 0 <= end_col < 8):
return False

piece = self.board[start_row][start_col]
if piece == ' ':
return False

# Check if it's the correct player's turn
if self.current_player == 'white' and piece.islower():
return False
if self.current_player == 'black' and piece.isupper():
return False

# Basic move validation (simplified)
if piece.upper() == 'P': # Pawn
return self.is_valid_pawn_move(start_row, start_col, end_row, end_col, piece)
elif piece.upper() == 'R': # Rook
return self.is_valid_rook_move(start_row, start_col, end_row, end_col)
elif piece.upper() == 'N': # Knight
return self.is_valid_knight_move(start_row, start_col, end_row, end_col)
elif piece.upper() == 'B': # Bishop
return self.is_valid_bishop_move(start_row, start_col, end_row, end_col)
elif piece.upper() == 'Q': # Queen
return self.is_valid_queen_move(start_row, start_col, end_row, end_col)
elif piece.upper() == 'K': # King
return self.is_valid_king_move(start_row, start_col, end_row, end_col)

return False
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The move validation doesn't check if the destination square contains a piece of the same color before allowing the move. A player could potentially capture their own pieces. Consider adding a check to ensure the destination piece (if any) belongs to the opponent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

choice = input("Enter your choice: ")

if choice == "1":
episodes = int(input("Enter number of training episodes (default 10000): ") or "10000")
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code uses int(input(...) or "10000") which will raise a ValueError if the user enters a non-numeric value other than an empty string. For example, if a user enters "abc", this will crash. Consider wrapping this in a try-except block or validating the input before conversion.

Suggested change
episodes = int(input("Enter number of training episodes (default 10000): ") or "10000")
while True:
episodes_input = input("Enter number of training episodes (default 10000): ")
if not episodes_input:
episodes_input = "10000"
try:
episodes = int(episodes_input)
break
except ValueError:
print("Invalid number. Please enter a valid integer.")

Copilot uses AI. Check for mistakes.
Comment thread Easy/26_Hangman.py Outdated
Comment thread Readme.md
Comment on lines +139 to +141
### #28 - Discord Bot

A feature-rich Discord bot with commands for games, utilities, server information, and user management.
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a discrepancy between the filename numbering and the README numbering. The README lists this as "#28 - Discord Bot", but the file is named "25_Discord_Bot.py". This inconsistency could confuse users trying to match projects in the README with their corresponding files. Consider either renumbering the file to "28_Discord_Bot.py" or updating the README to reference "#25".

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread Hard/26_Machine_Learning_Image_Classifier.py Outdated
Comment thread Hard/26_Machine_Learning_Image_Classifier.py Outdated
Comment thread Hard/26_Machine_Learning_Image_Classifier.py Outdated
Unknown27s and others added 6 commits February 1, 2026 09:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants