{"id":18292925,"url":"https://github.com/yuneg11/coding-test-helper","last_synced_at":"2025-04-09T08:13:31.345Z","repository":{"id":42715563,"uuid":"302623811","full_name":"yuneg11/Coding-Test-Helper","owner":"yuneg11","description":"Coding Test Helper is the tool to help online coding test","archived":false,"fork":false,"pushed_at":"2022-01-14T19:49:36.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T02:20:09.656Z","etag":null,"topics":["coding-test"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuneg11.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-09T11:40:11.000Z","updated_at":"2021-02-10T08:01:41.000Z","dependencies_parsed_at":"2022-08-23T15:10:12.015Z","dependency_job_id":null,"html_url":"https://github.com/yuneg11/Coding-Test-Helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuneg11%2FCoding-Test-Helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuneg11%2FCoding-Test-Helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuneg11%2FCoding-Test-Helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuneg11%2FCoding-Test-Helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuneg11","download_url":"https://codeload.github.com/yuneg11/Coding-Test-Helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999864,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding-test"],"created_at":"2024-11-05T14:20:02.998Z","updated_at":"2025-04-09T08:13:31.325Z","avatar_url":"https://github.com/yuneg11.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coding Test Helper\n\nCode Test Helper is the tool to help online coding test.\nSome sites uses an input file and an output file to evaluate the code.\nThis tool converts that io-type into the function-type.\n\nFor example (The sum of input numbers):\n\nConverts\n\n```text\n# input      # output\n5            15\n1 2 3 4 5\n```\n\n```python\nn = int(input())\nnumbers = list(map(int, input().split()))\nprint(sum(numbers))\n```\n\ninto\n\n```text\n# input                      # output\nn = 5                        return 15\nnumbers = [1, 2, 3, 4, 5]\n```\n\n```python\ndef solution(n, numbers):\n    return sum(numbers)\n```\n\n## Getting Started\n\n```bash\ngit clone https://github.com/yuneg11/CodingTestHelper.git\ncd CodingTestHelper\n```\n\n## Usage\n\nExample problem: [CodeUp:4654](https://codeup.kr/problem.php?id=4654)\n\n### Get the skeleton code\n\n```bash\npython3 main.py {site}:{problem-number}\n\n# Example\npython3 main.py codeup:4654\n```\n\nIf you want the function-type skeleton code, use \"solution\" function.\n\n```python\n# n: \u003cclass 'int'\u003e\n# heights: typing.List[int]\n# return: typing.List[int]\ndef solution(n, heights):\n    answer = []\n    return answer\n```\n\nIf you want the io-type skeleton code, use \"solution_raw\" function. \\\nYou should handle the input and the output process as before.\n\n```python\n# file: \u003cclass '_io.TextIOWrapper'\u003e\n# return: \u003cclass 'str'\u003e\ndef solution_raw(file):\n    input_lines = file.readlines()\n    answer = \"\"\n    return answer\n```\n\n### Test the solution code\n\n```bash\npython3 main.py {site}:{problem-number} -s {solution-file-path}\n\n# Example\npython3 main.py codeup:4654 -s solution/codeup4654.py\n\n# If you want to save the solution code for submit\npython3 main.py codeup:4654 -s solution/codeup4654.py -o submit.py\n```\n\nIf you pass all the test cases, you can submit the generated submit code.\n\n## Add problems\n\nFor now, the only supported site is [CodeUp](https://codeup.kr) \\\nTo add more problems, follow steps below.\n\n### 1. Copy the template folder\n\nCopy `data/codeup/template` folder to `data/codeup/id{problem-num}`. \\\nJust copy and paste the folder or use the below command.\n\n```bash\ncp -r data/codeup/template data/codeup/id{problem-num}\n\n# Example (Problem num: 1234)\ncp -r data/codeup/template data/codeup/id1234\n```\n\n### 2. Modify `problem.py` file\n\nIf you want to provide function-type skeleton code, you should modify three functions. \\\nEven if not, users can still use io-type skeleton code.\n\n#### 2.1. Modify `read_input` function\n\nThe `read_input` function should receive only `file` as an argument and return arguments for `solution` function.\n\n```python\ndef read_input(file: TextIOWrapper) -\u003e Tuple[int, int]:\n    # You can use 'input()' to get inputs\n    input = lambda: file.readline().rstrip()\n\n    solution_arg1 = int(input())\n    solution_arg2 = int(input())\n    return solution_arg1, solution_arg2\n```\n\n#### 2.2. Modify `solution` function\n\nThe `solution` function should receive arguments that `read_input` returns and return the answer. \\\nYou only need to write the skeleton of it.\n\n```python\ndef solution(arg1: int, arg2: int) -\u003e int:\n    # You should provide skeleton code of solution\n    answer = 0\n    return answer\n```\n\n#### 2.3. Modify `print_output` function\n\nThe `print_output` function should receive the answer that `solution` function returns and return the string version of it.\n\n```python\ndef print_output(output: int) -\u003e str:\n    # You should convert output object to string\n    return str(output)\n```\n\n### 3. Add sample cases and test cases\n\nThe sample case is that the provided test case for example, and the test case is that the hidden test case for evaluating the score. \\\nIf you don't have that cases, just delete the `sample` folder or the `test` folder.\n\nThe name of the file should follow rules below.\n\n```text\n# input\n{case-number}i.txt\n\n# output\n{case-number}o.txt\n```\n\nThe 0s in front of the number are just placeholders. \\\nYou can ignore it.\n\nFor example,\n\n```text\n# Test case #1\n1i.txt = 01i.txt = 001i.txt\n1o.txt = 01o.txt = 001o.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuneg11%2Fcoding-test-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuneg11%2Fcoding-test-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuneg11%2Fcoding-test-helper/lists"}