mirror of
https://github.com/MeiK2333/river.git
synced 2025-11-04 14:49:40 +08:00
add language: Node
This commit is contained in:
parent
31caf33d9d
commit
1b1114a5d0
@ -19,6 +19,8 @@ def judge(path, language):
|
||||
filename = "main.rs"
|
||||
elif language == river_pb2.Go:
|
||||
filename = "main.go"
|
||||
elif language == river_pb2.Node:
|
||||
filename = "main.js"
|
||||
with open(path.joinpath(filename), "rb") as fr:
|
||||
code = fr.read()
|
||||
with open(path.joinpath("in.txt"), "rb") as fr:
|
||||
@ -44,34 +46,39 @@ def judge(path, language):
|
||||
def run():
|
||||
with grpc.insecure_channel("localhost:4003") as channel:
|
||||
stub = river_pb2_grpc.RiverStub(channel)
|
||||
for path in Path("java").iterdir():
|
||||
# for path in Path("java").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.Java)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
# for path in Path("c").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.C)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
# for path in Path("cpp").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.Cpp)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
# for path in Path("py").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.Python)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
# for path in Path("rust").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.Rust)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
# for path in Path("go").iterdir():
|
||||
# print(f"开始评测 {path}")
|
||||
# for item in stub.Judge(judge(path, river_pb2.Go)):
|
||||
# print(item)
|
||||
# print(f"{path} 评测完成")
|
||||
for path in Path("node").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.Java)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
for path in Path("c").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.C)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
for path in Path("cpp").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.Cpp)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
for path in Path("py").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.Python)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
for path in Path("rust").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.Rust)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
for path in Path("go").iterdir():
|
||||
print(f"开始评测 {path}")
|
||||
for item in stub.Judge(judge(path, river_pb2.Go)):
|
||||
for item in stub.Judge(judge(path, river_pb2.Node)):
|
||||
print(item)
|
||||
print(f"{path} 评测完成")
|
||||
|
||||
|
||||
0
example/node/1000/in.txt
Normal file
0
example/node/1000/in.txt
Normal file
1
example/node/1000/main.js
Normal file
1
example/node/1000/main.js
Normal file
@ -0,0 +1 @@
|
||||
console.log("Hello World!");
|
||||
1
example/node/1000/out.txt
Normal file
1
example/node/1000/out.txt
Normal file
@ -0,0 +1 @@
|
||||
Hello World!
|
||||
1
example/node/1001/in.txt
Normal file
1
example/node/1001/in.txt
Normal file
@ -0,0 +1 @@
|
||||
2 3
|
||||
15
example/node/1001/main.js
Normal file
15
example/node/1001/main.js
Normal file
@ -0,0 +1,15 @@
|
||||
const readline = require('readline');
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
rl.on('line', (line) => {
|
||||
var nums = line.split(' ');
|
||||
var a = parseInt(nums[0]);
|
||||
var b = parseInt(nums[1]);
|
||||
var res = a + b;
|
||||
console.log(res);
|
||||
process.exit(0);
|
||||
});
|
||||
1
example/node/1001/out.txt
Normal file
1
example/node/1001/out.txt
Normal file
@ -0,0 +1 @@
|
||||
5
|
||||
Loading…
Reference in New Issue
Block a user