Skip to content

tiger2005/FastOlympicCodingHook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

FastOlympicCodingHook

Problem test-case parser for sublime text from various online judges. Depends on Competitive Companion and FastOlympicCoding.

The repository is a copy from DrSwad/FastOlympicCodingHook with some changes, and the usage is different from the original one.

Setup

  • Make sure you have python3, FastOlympicCoding and Competitive Companion installed.
  • Clone the repository inside your Sublime Text Packages folder and rename the cloned folder to FastOlympicCodingHook. You can do a quick google search to locate that folder for your particular OS or you can click the "Browse Packages" option in Sublime Text (if you find it) and the folder will open itself.
  • Change the settings in FastOlympicCodingHook.sublime-settings, and restart Sublime Text. The extension will start a local server, so make sure the port is not conflicting.
  • Add the server port in the list of ports of competitive-companion browser extension.
  • Additional step for Windows users: Add the following line in the FastOlympicCoding settings file: "tests_file_suffix": "__tests".

Usage

In the browser, navigate to the problem page and click on the competitive-companion extension's green plus icon. A file will be generated by the template file and opened in the active view of Sublime Text, where you can write you code and test it by FastOlympicCoding.

The problem test cases and correct answers would be parsed and stored in a file named your filename__tests for Windows and your filename:tests for others. You can run your code using FastOlympicCoding plugin (ctrl+B), and the test cases will be tested and displayed.

Settings

The setting file includes several options.

  • template-file: The location of your template file. The code files will be adapted from it.
  • parse-folder: The location of you problem directory. / or \ is needed in the end of the string. Make sure the location doesn't contain white spaces or special characters, or the extensions won't work properly.
  • server-port: The port of the local server.
  • time-format: The format string for %$Time$%. The rules are in the setting file.
  • file-suffix: The file suffix of code files.

You can use some tags in the template file. The extension will detect and replace them.

  • %$Problem$%: Problem name.
  • %$Contest$%: Contest name.
  • %$URL$%: URL of the problem / contest.
  • %$Time$%: When the problem is parsed.
  • %$MemoryL$%: Memory limit of the problem, in MB.
  • %$TimeL$%: Time limit of the problem, in ms.

For example, you can add a quote at the front of the template file like:

/*******************************
| Author:  tiger2005
| Problem: %$Problem$%
| Contest: %$Contest$%
| URL:     %$URL$%
| When:    %$Time$%
| 
| Memory:  %$MemoryL$% MB
| Time:    %$TimeL$% ms
*******************************/

About

Problem test-case parser for sublime text from various online judges. Depends on Competitive Companion and FastOlympicCoding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%