This document contains instructions on how to use this extension.
This image is outdated. Please refer to README for an updated UI. The button actions remain the same.
-
Install cph by following the instructions given in the link.
-
Install competitive companion browser extension in your browser, using the instructions given in the link.
-
Open any folder in VS Code (Menu>File>Open Folder).
-
Use Companion by pressing the green plus (+) circle from the browser toolbar when visiting any problem page.
-
The file opens in VS Code with testcases preloaded. Press
Ctrl+Alt+B
to run them. Or, use the 'Run Testcases' button from the activity bar ( in the bottom).
-
Write some code in any supported language ( .cpp, .c, .rs, .python).
-
Launch the extension: Press
Ctrl+Alt+B
to run them. Or, use the 'Run Testcases' button from the activity bar ( in the bottom). -
Enter your testcases in the window opened to the side.
-
Then, you can run them.
- Install cph-submit on Firefox.
- After installing, make sure a browser window is open.
- Click on the 'Submit to CF' button in the results window.
- A tab opens in the browser and the problem is submitted.
-
Install Kattis config file and submission client. Make sure you are logged in on another tab prior to accessing the files.
-
Move these files to a directory(folder) called .kattisrc in your home directory.
- On MacOS, this is typically /Users/{username}/.kattisrc
- On Linux, this is typically /home/{username}/.kattisrc
- On Windows, this is typically C:\Users\{username}\.kattisrc
-
If any errors come up, check which directory
~
is linked to, by runningpython -c "import os; print(os.path.expanduser('~'))"
in a terminal.
-
Click on the 'Submit to Kattis' button in the results window.
-
A new tab will open in the browser with the submissions page.
- For C++,
DEBUG
andCPH
are defined as a#define
directive.
Several options are available to customize the extension. Open VS Code settings (From the gear icon on bottom-left) and go to the 'competitive-programming-helper' section. You can choose several settings like:
- Default save location for generated meta-data.
- Default language selected for new problems imported via Competitive Companion.
- Language choices offered in menu when new problem imported via Competitive Companion.
- Timeout for testcases.
- Additional compilation flags.
- [Requires cph-submit] Compiler selected in drop down during codeforces submission.
- [Python] Command used to run python files. For eg. py, python3, pypy3, etc.
If you have trouble using the extension, find any bugs, or want to request a new feature, please create an issue here.