generator-oj-problem 0.1.0-beta

This is a prerelease version of generator-oj-problem.
dotnet tool install --global generator-oj-problem --version 0.1.0-beta
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local generator-oj-problem --version 0.1.0-beta
This package contains a .NET tool you can call from the shell/command line.
#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

Package on NuGet Download on NuGet alternate text is missing from this package README image

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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.

  1. Download the release for your OS (uploaded in the group).
  2. Unzip the package
  3. 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.

  1. Install .NET Core SDK for your OS.
    • Here is the website to download .NET Core.
  2. If you want to use main version:
    1. Use this command to install gop:
    $ dotnet tool install -g generator-oj-problem --version 0.1.0-alpha
    
  3. If you want to use latest version:
    1. Download the nupkg file in release page,
    2. Enter the directory of the nupkg file, use this command to install gop:
    $ dotnet tool install -g generator-oj-problem --add-source ./ --version 0.1.0-alpha
    
  4. After installed, use gop to run the tool. Use this command to check the tool has been installed:
$ gop --version

$ gop --help

Getting Started

  1. Use these command to create one directory for your problem:
$ mkdir problem
$ cd problem
$ gop init
  1. Modify the files in the directory problem.
    1. profile.json Config information
    2. descriptions/ All text for description.
      1. The file with extension .md means it supports plain CommonMark by built-in render.
        • Attention: No LaTeX and embeded image supports.
      2. descriptions/description.md Description
      3. descriptions/input.md Description of input
      4. descriptions/output.md Description of output
      5. descriptions/hint.md Hint
      6. descriptions/source.txt Source
    3. samples/ Sample data
      1. samples/test0.in Input of sample
      2. samples/test0.out Output of sample
    4. tests/ Test data (same form to samples/)
    5. src/std.cpp Standard program
  2. After you finish standard program, compile it and fill the StdRun field in profile.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 and gen commands you will use later.
  3. 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
  1. 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
  1. If you want to preview your problem, use this command:
$ gop preview

# preview by HTML
$ gop preview --html
  1. 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 with fps):
$ 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.
  • 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 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. 
.NET Core netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.1.0-beta 380 3/30/2019
0.1.0-alpha 378 3/7/2019