diff parser for judging #4

Closed
opened 2024-03-01 11:41:10 +08:00 by 张泊明518370910136 · 2 comments

Compare the output of the program executed with answer.

  1. implement a Myers algo, return the line numbers, and output the different lines as comment
  2. ignore whitespace (or not)
  3. only show first lines of differnces to control the length of output
  4. use diff block to display on gitea issues
line 0
- line 0
+ line 1
line 2
Compare the output of the program executed with answer. 1. implement a Myers algo, return the line numbers, and output the different lines as comment 2. ignore whitespace (or not) 3. only show first lines of differnces to control the length of output 4. use `diff` block to display on gitea issues ```diff line 0 - line 0 + line 1 line 2 ```
张泊明518370910136 added the
priority
p1
label 2024-03-01 11:41:10 +08:00
张泊明518370910136 added this to the (deleted) project 2024-03-01 11:41:11 +08:00
manuel added the
component
parser
label 2024-03-01 19:04:33 +08:00
张泊明518370910136 changed title from Check & Show `stdout` difference to diff parser for judging 2024-04-01 04:48:19 +08:00

got results like this currently (example in diff/basic), the answer should be 3072

[{"name":"compile","results":[{"score":0,"comment":""}],"force_quit":false},{"name":"run","results":[{"score":100,"comment":"executor status: run time: 4652569 ns, memory: 331776 bytes\n"},{"score":0,"comment":"executor status: run time: 4519757 ns, memory: 544768 bytes\ndifference found at line 1:\n```diff\n- 234890234\n+ 3072\n- 342342\n- 1234234\n- 300072\n- 43234\n- 1243\n  \n```"}],"force_quit":false}]
- 234890234
+ 3072
- 342342
- 1234234
- 300072
- 43234
- 1243
  
  3072
- 234890234
- 342342
- 1234234
- 300072
- 43234
- 1243
  
got results like this currently (example in diff/basic), the answer should be `3072` ```json [{"name":"compile","results":[{"score":0,"comment":""}],"force_quit":false},{"name":"run","results":[{"score":100,"comment":"executor status: run time: 4652569 ns, memory: 331776 bytes\n"},{"score":0,"comment":"executor status: run time: 4519757 ns, memory: 544768 bytes\ndifference found at line 1:\n```diff\n- 234890234\n+ 3072\n- 342342\n- 1234234\n- 300072\n- 43234\n- 1243\n \n```"}],"force_quit":false}] ``` ```diff - 234890234 + 3072 - 342342 - 1234234 - 300072 - 43234 - 1243 ``` ```diff 3072 - 234890234 - 342342 - 1234234 - 300072 - 43234 - 1243 ```
Author
Owner

Done in #33.

Done in #33.
Sign in to join this conversation.
No description provided.