Skip to content

Momokh99/terminal_games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

terminal_games

terminal_games A collection of planned terminal-based games written in C and Python. The project combines a lightweight C game engine with Python-based text user interfaces to create simple, fast, and educational command-line games. Overview terminal_games is a learning-oriented project designed to explore: • writing a reusable C game engine • building shared libraries (libeng.so) • creating Python TUIs that call C code • organizing a multi-language project • using Git for real-world development Games Included • Rock-Paper-Scissors (Python TUI) • Number Guessing Game (Python TUI) • Additional games planned in future expansions Project Structure engine/ eng.c – core C engine logic Makefile – builds libeng.so build/ – output directory for shared objects tui/ main.py – game selector and launcher Roc-pap-sic.py – rock-paper-scissors UI guess.py – number guessing UI docs/ (planned) technical documentation diagrams dev notes How to Build the C Engine cd engine make This generates build/libeng.so automatically. How to Run the Games cd tui python main.py Requirements • Python 3 • GCC or Clang (to build the C engine) • Linux recommended for smooth shared library handling Installation (Optional) Clone the repository: git clone https://github.com/Momokh99/terminal_games.git cd terminal_games Build the engine and run the TUI as described above. Technical Notes • The C engine is compiled into a shared library (libeng.so). • Python loads the library using ctypes or cffi (planned). • The engine will eventually provide reusable functions for:

  • random number generation
  • turn management
  • score handling
  • generic game loops
  • input validation

Planned Improvements General • Add more games • Create unified UI theme for TUI • Add logging for debugging • Add configuration file for difficulty levels Engine Side (C) • Add a generic game loop • Add reusable scoring system • Add utility functions (timer, RNG wrapper, input helpers) • Add error handling • Add unit tests (planned in C using Unity or Criterion) Python TUI • Improve game menus • Add colorful ASCII art • Add keyboard navigation (arrow keys) • Add help/instructions screen • Add sound support (optional) Project Management • Add versioning (v0.1.0, etc.) • Add CHANGELOG file • Add CONTRIBUTING guide GitHub Integrations (Planned) • GitHub Actions to auto-build libeng.so • GitHub Actions to auto-run Python tests • Release system: upload compiled engine libraries • Automated docs deployment Long-Term Ideas • Implement simple multiplayer over terminal • Add AI difficulty levels • Add save/load support • Add leaderboard file • Create a web version using WebAssembly (for C engine) Why This Project Exists This project is both a practical coding playground and a learning journey combining C, Python, Git, and Linux development practices. It aims to be simple enough for beginners yet expandable enough for serious improvement. License This project is for learning and personal development. Use it freely and modify as you like.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published