Skip to content

UbaidullahWaheed/Games.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Game Hub โ€” Tic-Tac-Toe & Hangman

Python Tkinter Games License Internship

A premium dark-themed Game Hub featuring two fully-featured classic games โ€” Tic-Tac-Toe with a smart AI opponent and Hangman with 60+ words across 5 categories. Built entirely with Python and Tkinter.


๐Ÿ•น๏ธ Games Included

โŒโญ• Tic-Tac-Toe

Feature Details
๐Ÿค– AI Opponent Minimax algorithm with Alpha-Beta pruning โ€” unbeatable on Hard
๐ŸŽฏ Difficulty Levels Easy (random) ยท Medium (mixed) ยท Hard (perfect play)
โœ‹ Choose Your Mark Play as X or O
๐Ÿ† Score Tracking Wins ยท Draws ยท Losses per session
๐ŸŒŸ Win Highlighting Winning cells highlighted green (you) or red (AI)
๐Ÿ“œ Move History Live log of every move made

๐Ÿชข Hangman

Feature Details
๐Ÿ“‚ 5 Categories Animals ยท Countries ยท Technology ยท Sports ยท Food
๐Ÿ“ 60+ Words Unique words with individual hints for each
๐ŸŽจ ASCII Art Animated 7-stage hangman drawing
โŒจ๏ธ Dual Input On-screen keyboard buttons + physical keyboard typing
๐Ÿ’ก Hint System One hint available per game
๐Ÿ”ด Letter Tracking Wrong letters highlighted red, correct ones green
๐Ÿ† Score Tracking Wins & Losses per session

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.x (Tkinter is included by default)

Run the App

git clone https://github.com/YOUR_USERNAME/HexSoftwares_Game_Hub.git
cd HexSoftwares_Game_Hub
python games.py

๐Ÿค– How the AI Works (Tic-Tac-Toe)

The AI uses the Minimax algorithm with Alpha-Beta pruning:

  • Minimax โ€” recursively evaluates all possible game states and picks the optimal move
  • Alpha-Beta pruning โ€” skips branches that can't affect the result, making it faster
  • On Hard difficulty the AI plays a perfect game โ€” it never loses
  • On Medium it makes random moves 35% of the time for a fair challenge
  • On Easy it plays fully randomly
Score:  AI wins  โ†’ +10 - depth
        You win  โ†’ depth - 10
        Draw     โ†’ 0

๐Ÿ“ Project Structure

HexSoftwares_Game_Hub/
โ”‚
โ”œโ”€โ”€ games.py     # Main application (GameHub + TicTacToe + Hangman)
โ””โ”€โ”€ README.md    # Project documentation

๐Ÿ—‚๏ธ Word Categories (Hangman)

Category Sample Words
๐Ÿ˜ Animals elephant, butterfly, kangaroo, flamingo, chameleon
๐ŸŒ Countries pakistan, australia, switzerland, indonesia, portugal
๐Ÿ’ป Technology python, algorithm, blockchain, kubernetes, encryption
โšฝ Sports basketball, gymnastics, badminton, archery, wrestling
๐Ÿ• Food spaghetti, croissant, quesadilla, avocado, watermelon

๐Ÿ› ๏ธ Built With

  • Python 3 โ€” Core language
  • Tkinter โ€” GUI framework (built-in)
  • Random โ€” Word selection & Easy AI moves (built-in)

โœ… Zero external dependencies โ€” runs out of the box!


๐Ÿ“ธ App Preview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐ŸŽฎ  GAME HUB              Hex Softwares Internship โ”‚
โ”‚  ๐Ÿ† Session: TTT W:2 D:1 L:0   Hangman W:3 L:1    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                       โ”‚                            โ”‚
โ”‚      โŒโญ•             โ”‚         ๐Ÿชข                 โ”‚
โ”‚   Tic-Tac-Toe         โ”‚       Hangman              โ”‚
โ”‚                       โ”‚                            โ”‚
โ”‚  Smart AI ยท 3 levels  โ”‚  5 categories ยท 60+ words  โ”‚
โ”‚                       โ”‚                            โ”‚
โ”‚  [ โ–ถ Play ]           โ”‚  [ โ–ถ Play ]                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ‘จโ€๐Ÿ’ป Author

Ubaidullah Waheed Developed as Task 3 of the Hex Softwares Python Programming Internship.


๐Ÿ“„ License

This project is licensed under the MIT License.

About

๐ŸŽฎ Premium Python Game Hub with Tic-Tac-Toe (Minimax AI + Alpha-Beta pruning, 3 difficulty levels) and Hangman (5 categories, 60+ words, hints, ASCII art animation). Dark-themed GUI built with Tkinter. Zero external dependencies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages