A toolkit for language-agnostic competitive programming, focused on POSIX systems.
Competitive Programming demands not only knowledge about data structures, algorithms and mathematics, but also about programming languages. After all, what value does a good idea have if it cannot be properly implemented?
Some languages are better for low level tasks, others are just easier to quickly hack something together. Still, programming competitions tend to challenge participants with all kinds of problems. That's why, even though some "swiss-knife" languages are preffered for tackling all sorts of tasks, languages crafted for special types of problems are equally relevant.
The problem is: keeping a polyglot development environment consistent and tidy is oftentimes harder than it may seem. What this toolkit promotes is an abstraction for developing with different programming languages at once. You can think of it as a console interface of a very simple integrated development environment.
Apart from bash, different sets of dependencies are required for running and debugging programs of each language. Since you'll most likely be working with only a portion of them, the following table is there to help you determine which software you actually need.
| Programming Language | Label | Running | Debugging |
|---|---|---|---|
| C | c |
gcc, make | gdb |
| C++ | cpp |
g++, make | gdb |
| C# | cs |
mcs, make | gdb (1) |
| Go | go |
go, make | gdb (2) |
| Haskell | haskell |
ghc, make | gdb (4) |
| Java | java |
javac, java, make | jdb |
| Javascript | js |
node | |
| Kotlin | kotlin |
konanc, make | gdb (5) |
| Pascal | pascal |
fpc, make | gdb (3) |
| Perl | perl |
perl | |
| Python | python |
python | |
| Ruby | ruby |
ruby |
Some commands require additional software too:
| Command | Dependencies |
|---|---|
| edit | vi |
| copy | clip.exe, xclip or pbcopy |
| paste | powershell.exe, xclip or pbpaste |
- Check out this repository where you want it installed. A good place is in the home directory (but you could install it anywhere else).
git clone https://github.com/guidanoli/cptk.git ~/.cptk- Edit your shell profile if you want to access the
cptkcommand-line utility.
echo 'export PATH=$PATH:$HOME/.cptk/bin' >> ~/.bashrcThe toolkit is accessed by the cptk script.
Run cptk --help for usage information.
After installing all the dependencies, you can run tests/all.