generator-oj-problem
0.1.0-beta
dotnet tool install --global generator-oj-problem --version 0.1.0-beta
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local generator-oj-problem --version 0.1.0-beta
#tool dotnet:?package=generator-oj-problem&version=0.1.0-beta&prerelease
nuke :add-package generator-oj-problem --version 0.1.0-beta
generator-oj-problem
A CLI tool to generate Online-Judge Problem.
Install
Use one of the following methods to install this tool:
Portable
This methods do not install the tool into your system, so you must use the tool by the full-path.
You can also add it to the environment variable PATH
.
- Download the release for your OS (uploaded in the group).
- Unzip the package
- The tool is in the unzipped directory, named
gop
.
Global (Deprecated)
This methods install the tool into your system, and you can use the tool anywhere.
Attention: The tool depends on .NET Core, so you need to install .NET Core first.
- Install .NET Core SDK for your OS.
- Here is the website to download .NET Core.
- If you want to use main version:
- Use this command to install
gop
:
$ dotnet tool install -g generator-oj-problem --version 0.1.0-alpha
- Use this command to install
- If you want to use latest version:
- Download the
nupkg
file in release page, - Enter the directory of the
nupkg
file, use this command to installgop
:
$ dotnet tool install -g generator-oj-problem --add-source ./ --version 0.1.0-alpha
- Download the
- After installed, use
gop
to run the tool. Use this command to check the tool has been installed:
$ gop --version
$ gop --help
Getting Started
- Use these command to create one directory for your problem:
$ mkdir problem
$ cd problem
$ gop init
- Modify the files in the directory
problem
.profile.json
Config informationdescriptions/
All text for description.- The file with extension
.md
means it supports plain CommonMark by built-in render.- Attention: No LaTeX and embeded image supports.
descriptions/description.md
Descriptiondescriptions/input.md
Description of inputdescriptions/output.md
Description of outputdescriptions/hint.md
Hintdescriptions/source.txt
Source
- The file with extension
samples/
Sample datasamples/test0.in
Input of samplesamples/test0.out
Output of sample
tests/
Test data (same form tosamples/
)src/std.cpp
Standard program
- After you finish standard program, compile it and fill the
StdRun
field inprofile.json
with the path of compiled executable file (or a list of commands to execute standard program if you use Python).- This enables local judger for
check
andgen
commands you will use later.
- This enables local judger for
- Add all inputs for samples and tests, and finish step 3, then you can use this command to auto-generate outputs:
# If you change standard program, recompile it and then re-gen.
# gen command won't auto-compile for you.
$ gop gen
- After you finish things above, use this command to check whether your directory is available to pack:
$ gop check
# disable local judger (not recommended)
$ gop check --disable-local-judger
- If you want to preview your problem, use this command:
$ gop preview
# preview by HTML
$ gop preview --html
- After you fix up all errors and warnings, use this command to pack your problem and then you can submit the package(Always use
--platform
option withfps
):
$ gop pack --platform fps
# disable local judger when check (not recommended)
$ gop pack --disable-local-judger --platform fps
# force pack although checking failed
# (not recommended, and the package won't be accepted when submit)
$ gop pack --force --platform fps
Example:
Here is a problem example. Compile src/std.cpp
before you check it.
Addition:
- If you have addition files (such as images), add to
/extra/
directory, and all files in this directory will be packed.- In this case, use
--platform hustoj
instead of--platform fps
.
- In this case, use
- Use
--help
to see more information about this tool.
Have fun!
If you have any suggestions or you find any bugs, please tell me.
Command
These are more details for the commands of gop
.
init
Initialize the problem. The current directory must be empty.
$ gop init
preview
Preview the problem.
Option | Description |
---|---|
--html |
Generate an HTML document for previewing. |
$ gop preview
gen
Generate data.
Option | Description |
---|---|
-o, --output |
Generate output data for samples and tests. |
$ gop gen
check
Check whether the problem is available to pack.
Option | Description |
---|---|
--disable-local-judger |
Disable local judging for check. |
-p, --platform |
The target platform: generic , hustoj , fps |
$ gop check
pack
Pack the problem into one package to submit.
Option | Description |
---|---|
--force |
Pack although checking failing. |
--disable-local-judger |
Disable local judging for check. |
-p, --platform |
The target platform: generic , hustoj , fps , localjudge |
$ gop pack
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.1.0-beta | 403 | 3/30/2019 |
0.1.0-alpha | 390 | 3/7/2019 |