chundoong-lab-ta/SHPC2022/hw1.py

19 lines
1.2 KiB
Python
Raw Normal View History

2022-10-14 03:09:32 +09:00
from shpc_grader import SHPCProblem, SHPCTestCase
def hw1_correct_currying(answer, score):
return lambda submitted: (score if (submitted.strip() == answer) else 0)
2022-10-14 03:25:40 +09:00
hw1_2 = SHPCProblem("hw1-2", "hw1", "hw1",
2022-10-14 03:09:32 +09:00
[ "convert.c" ],
[
SHPCTestCase("./convert int 4155", hw1_correct_currying('00000000000000000001000000111011', 5)),
SHPCTestCase("./convert long -550" , hw1_correct_currying('1111111111111111111111111111111111111111111111111111110111011010', 5)),
SHPCTestCase("./convert float 3.1415" , hw1_correct_currying('01000000010010010000111001010110', 5)),
SHPCTestCase("./convert double 3.1415" , hw1_correct_currying('0100000000001001001000011100101011000000100000110001001001101111', 5)),
SHPCTestCase("./convert int -1" , hw1_correct_currying('11111111111111111111111111111111', 5)),
SHPCTestCase("./convert long -1" , hw1_correct_currying('1111111111111111111111111111111111111111111111111111111111111111', 5)),
SHPCTestCase("./convert float -1" , hw1_correct_currying('10111111100000000000000000000000', 5)),
SHPCTestCase("./convert double -1" , hw1_correct_currying('1011111111110000000000000000000000000000000000000000000000000000', 5)),
],
)