CnPython
CnPython copied to clipboard
Trying to implement python functions in C so it's easier to read.
CnPython
Implementing most of pythons builtin functions in C, making it easier to read.
Compile
Go to the makefile and adjust it to your needs.
How to contribute
Just create an issue if you have an idea for a builtin function or create a new pull request if you can also write the code for that. When I will have more time to spend on this project I will definetly contribute a little bit more.
Implemented functions
- [x] type(var),
- [x] bin(decimal),
- [x] hex(decimal),
- [x] oct(decimal),
- [x] pow(base, exponent),
- [x] str(number),
- [x] _int(string),
- [x] input(prompt),
- [x] reverse(arr, size),
- [x] min(arr, size),
- [x] max(arr, size),
- [x] print(*format, ...),
- [x] sorted(arr, size),
- [x] sum(arr, size),
- [x] str_len(str),
- [x] str_count(str, find),
- [x] endswith(str, element),
- [x] replace(str, find, repl),
- [x] find(str, find),
- [x] startswith(str, element),
- [ ] str_split(arr, str, del),
- [x] printSplit(str, del),
- [ ] split(arr, str, del)
- [x] chr(ascii)
- [x] ord(char)
- [x] isin(str, value)
- [x] rem(a, b)
- [x] percentage(p, n)
- [x] iappend(arr, value, size)
- [x] copy(arr, dest, size)
- [x] arr_count(arr, value, size)
- [x] arr_find(arr, value, size)
- [x] pop(arr, size)
License
This code is under a MIT license. This means you can do whatever you want with the code but the same license has to be in your project if you want to use this in your project.