Skip to content

Competitive Programming Contests Automation Package for text editor Atom.

License

Notifications You must be signed in to change notification settings

horcrux2301/AFCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AFCP

AFCP is a Competitive Programming Contests Automation Package for text editor Atom.

Installs! Package version! GitHub stars GitHub forks GitHub issues GitHub license Made with Love in India

YouTube video explaining how to use the package

YouTube Icon

Sites Supported Yes
Codechef
Codeforces
Atcoder

Note:- The package has been fairly tested for MacOS and Linux. However Windows users might face some issues. Please open one in the repo if you do..

The notification feature is not currently supported for windows. I don't have access to a machine right now to test the code for windows, but you can expect an update for windows in a couple of days.

Never used atom for competing? Read this

Installation

Install package either by running apm install afcp from the terminal or by searching in the Install menu from Atom.

You will also need to install the following to use the package properly.

Linux -

  1. Install gcc

MacOS-

  1. Install gcc. This can be done by installing Xcode or Command Line Developer Tools.

Windows -

  1. Install MinGW.

Usage

Add the directory locations

Add directory locations for each site i.e where you want the folder for the problems to be created.

Image

An example location can look like this:- /Users/harshkhajuria/Desktop/TEST/ .

Important. Don't forget to add a /(for MacOS and Linux) or \ (for Windows) at the end of the location.

You can drag and drop the folder into terminal to get the paths

Drag and drop

coreutils is used to make sure that your code doesn't goes into an infinite loop. The time limit right now is 5 seconds which can be edited from the setting menu. (There is no need to install coreutils since version 0.8.18).

To fetch the problems and testcases

Image

Press alt+control+k to open the pane. Check the site radio button and put the contest code into the input field. Press Fetch Data .

A folder will be created for each of the problems with their test cases in the directory that you specify in the settings menu.

Examples for Code of Contests.

Site Link Code
Codechef https://www.codechef.com/COOK94A COOK94A
Codechef https://www.codechef.com/MAY18B MAY18B
Codeforces http://codeforces.com/contest/354 354
Codeforces http://codeforces.com/contest/490 490
Atcoder https://arc097.contest.atcoder.jp/ arc097
Atcoder https://agc024.contest.atcoder.jp/ agc024

In order to close the pane press again ctrl+alt+k

To compile and create output files

Press alt+control+c to compile. One output file will be generated for each and every file that starts with input in the folder where .cpp file is.

In order to create your own test cases create a input*.txt file in the same directory of the problem replacing * with a integer. Corresponding output file can be generated by pressing alt+control+c again.

Since version 0.8.18, I have also added notifications based on the diffs generated between output*.txt and myOutput*.txt.

Drag and drop

If no corresponding file is found either for output or myOutput a notification will be added and only time taken for the execution will be shown.

To see diffs

Press alt+control+p to bring out a right pane to see the diffs generated between corresponding files. To close the pane press alt+control+o.

To change gcc version and add additional flags while compiling

Update the Default GCC in the settings menu with the gcc version of your choice. For example if you use homebrew to install g++-4.9 then simply update the settings to use g++-4.9.

Update the GCC Options in the settings menu to add additional flags while compiling. For eg:- -std=c++14

To change the Time Limit

Update the Time Limit in the settings menu (in seconds).

Packages

Install the following packages for using atom to code in C/C++. To install them go to Install in Preferences and search them by typing their name.

  1. autocomplete-clang - Autocompletion of C/C++ code.
  2. gpp-compiler - Compile C/C++ code from within Atom.
  3. linter - Base Linter.
  4. linter-ui-default - Default UI for the linter package.
  5. linter-clang - Linter for C/C++ files.