Skip to content

CypherKingdom/PythonCodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Code Collection

This repository contains a well-organized collection of Python programs demonstrating various concepts, algorithms, data structures, and games.

Project Structure

The project is organized into the following main directories:

Games (games/)

  • tictactoe.py - A classic Tic-Tac-Toe game where you play against the computer
  • hangman.py - A graphical Hangman game using Tkinter
  • arcade.py - Collection of arcade-style games
  • interface.py - GUI applications and interface examples using Tkinter

Math (math/)

  • algorithms.py - Collection of common algorithms (Two Sum, binary search, merge sort)
  • calculator.py - Mathematical calculation utilities
  • data_structures.py - Functions for list, array, and set operations
  • matrix.py - Matrix operations and utilities
  • number_theory.py - Number theory functions (factorials, prime numbers, Collatz Conjecture)
  • string_utils.py - String manipulation and processing utilities

Models (models/)

  • geometry.py - Classes for geometric calculations (Point, Rectangle, Circle, Triangle)
  • education.py - Education-related utilities (grade conversion, statistics)
  • finance.py - Financial calculations and models
  • commerce.py - E-commerce and business models
  • device.py - Device and hardware-related models
  • student.py - Student data models and utilities
  • message_routing.py - Encrypted message routing system for secure communication networks

How to Run

All programs can be run using Python 3:

python -m module_path.filename

For example:

python -m games.hangman
python -m math.number_theory
python -m models.geometry

Game Instructions

Tic-Tac-Toe

  • You play as 'O' against the computer which plays as 'X'.
  • Select a position by entering a number from 1-9.
  • The first player to get three in a row wins.

Hangman

  • The program randomly selects a word for you to guess.
  • Click on letter buttons to make guesses.
  • Guess the full word before the hangman is completely drawn.

Math and Algorithm Features

Number Theory

  • Factorial calculation
  • Prime number checking
  • Collatz Conjecture implementation
  • GCD and LCM calculations

Algorithms

  • Two Sum problem solution
  • Binary search implementation
  • Merge sort algorithm
  • Maximum subarray sum

Models and Utilities

Geometry

  • Point class with distance calculations
  • Rectangle class with area and perimeter methods
  • Circle class with area and circumference methods
  • Triangle class with area, perimeter and validity checking

Education

  • Grade to GPA conversion
  • Statistical analysis of grade distributions
  • Education data processing tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages