2.2.0 • Published 7 years ago

simple-judger v2.2.0

Weekly downloads
26
License
ISC
Repository
github
Last release
7 years ago

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

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago