PYCC: Python Parser for graphics.h
This is a CLI to read, interpret and execute C programs having graphics.h
dependency. At its core, it is a small
interpreter for C with support for graphics.h
Supported Functions
initgraph
getchar
orgetch
closegraph
outtextxy
setcolor
arc
bar
line
rectangle
ellipse
fillellipse
fillpoly
fillcircle
drawpoly
getfontcolor
pieslice
sector
cleardevice
getmaxx
getmaxx
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
You need pipenv
or any other virtual environment tool.
$ pip install pipenv
Installing
Install the dependencies:
$ pipenv install
Usage
# setup shell in root of this repo
$ pipenv shell
$ ./pycc <path/to/main.c>
Running Samples
$ ./pycc samples/sample.c
$ ./pycc samples/car.c
$ ./pycc samples/smiley.c
Running the tests
Unit Tests
$ pipenv run test
Coverage
$ pipenv run cov
Built With
- pycparser - Complete C99 parser in pure Python
- PyEasyGraphics - A Turbo C Graphics Style Graphics library for python
- pytest - Testing
License
This project is licensed under the MIT License - see the LICENSE file for details