simple-judger

2.2.0 • Public • Published

Simple Judger

A simple npm module to judge C/C++ program.(Linux only) using EasySandbox for safety judge

jsdoc link

Install:

sudo? npm install simple-judger

Usage:

var judge=require('simple-judger');
var options={
    src: `#include<iostream>
using namespace std;
......`, //code !REQUIRED!
    in: '', //input string
    out: '', //output string
    timelimit: 1000, //ms !REQUIRED!
    compile: 'g++ -o {out} {dest}', //compile command, {source} {out} will be replaced !REQUIRED!
    result: { //result strings, these are default value
        Accepted: 'AC',
        Runtime_Error: 'RE',
        Time_Limit_Exceeded: 'TLE',
        Compile_Error: 'CE',
        Wrong_Answer: 'WA',
        System_Error: 'SE'
    }
};
judge(options).then(result=>{
    console.log(result);
});

Result Object:

{
    result: 'AC',
    time: 10,
    extra: 'Hello World' 
    //extra in different result represent different result
}

run npm test for testing

Installation Error:

if "permission denied" appear, add sudo then install again

others error please create a Issue on github

Readme

Keywords

none

Package Sidebar

Install

npm i simple-judger

Weekly Downloads

1

Version

2.2.0

License

ISC

Last publish

Collaborators

  • maple3142