/python-fun-projects

The Python Projects Repository features two projects: Connect 4 Game: Play against an AI using the Minimax Algorithm with alpha-beta pruning, visualized with Pygame. Voice Calculator: Perform basic arithmetic with voice feedback using the pyttsx3 library. Both showcase Python’s ability to create interactive applications.

Primary LanguagePythonMIT LicenseMIT

🎮 Python Projects Repository

This repository contains two Python-based projects:

  • 🔴 Connect 4 Game using Minimax Algorithm and Pygame
  • 🧮 Voice Calculator with pyttsx3

🔴 Connect 4 Game using Minimax Algorithm and Pygame

Overview

This project is a Python implementation of the classic Connect 4 game 🎮. Play against an AI opponent that uses the Minimax Algorithm with alpha-beta pruning to simulate intelligent decision-making.

Features

  • 👤 Single Player Mode: Play as Player 1 against the AI (Player 2).
  • 🤖 AI Opponent: The AI uses the Minimax Algorithm to determine the best moves.
  • 🔄 Dynamic Gameplay: Visualized using the pygame library.
  • 🎯 AI Strategy: Alpha-beta pruning optimizes the decision-making process, ensuring efficient gameplay.

Libraries Used

  • pygame 🎮: For creating the game window and rendering the game board.
  • numpy 🔢: For efficient array manipulations.
  • math ➗: For handling game calculations.

How to Run

  1. Install the required libraries:
    pip install pygame numpy
  2. Run the Python script:
    python connect4.py

Enjoy the game! 🕹️

🧮 Voice Calculator with pyttsx3

Overview

This project is a Voice Calculator that takes basic mathematical input from the user via text and provides voice feedback using the pyttsx3 library 🔊. It supports basic arithmetic operations like addition, subtraction, multiplication, and modulus.

Features

  • 🎤 Voice Interaction: The calculator interacts with the user via voice.
  • Basic Operations: Performs addition, subtraction, multiplication, and modulus.
  • 👤 Personalized Experience: Prompts the user for their name and reads the result aloud.
  • 🗣️ Text-to-Speech: Uses pyttsx3 for text-to-speech conversion.

Libraries Used

  • pyttsx3 🔊: For text-to-speech conversion.

How to Run

  1. Install the required library:
    pip install pyttsx3
  2. Run the Python script:
    python voice_calculator.py
  3. Start calculating with voice responses! 🧠

💻 Project Structure

📁 Python Projects ├── connect4.py # Connect 4 Game script └── voice_calculator.py # Voice Calculator script 🔗 Useful Links

Enjoy coding and have fun! 😄