Skip to content

Commit

Permalink
feat: update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed Aug 29, 2024
1 parent 9599308 commit 698eb9b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 36 deletions.
21 changes: 5 additions & 16 deletions .vscode/template.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"using namespace std;",
"",
"#ifdef STARCEA",
"#include \"debug.hpp\"",
"#include \"../debug.hpp\"",
"#else",
"#define debug(...)",
"#endif",
Expand All @@ -34,25 +34,14 @@
""
]
},
"ps-py": {
"py-py": {
"scope": "python",
"prefix": "ps",
"prefix": "py",
"body": [
"from sys import stdin, stdout",
"",
"stdin = open(0)",
"input = lambda: stdin.readline().rstrip()",
"_out: list[str] = []",
"print = lambda *v, sep=\" \", end=\"\\n\": _out.append(sep.join(map(str, v)) + end)",
"",
"",
"def main() -> None:",
" $0",
"",
"",
"if __name__ == \"__main__\":",
" main()",
"",
" stdout.write(\"\".join(_out))",
"$0",
""
]
},
Expand Down
2 changes: 1 addition & 1 deletion templates/cp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using namespace std;

using i64 = int64_t;

constexpr int _PREC = 0;
constexpr int _PREC = 0;

// #define int i64

Expand Down
15 changes: 0 additions & 15 deletions templates/ps.py

This file was deleted.

4 changes: 4 additions & 0 deletions templates/py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
stdin = open(0)
input = lambda: stdin.readline().rstrip()

# code here
4 changes: 0 additions & 4 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ def language(ext: str) -> str:
def main() -> int | None:
json: dict[str, SnippetSchema] = {}

if path.exists(SNIPPET_FILE):
with open(SNIPPET_FILE, "r") as f:
json = loads(f.read())

for file in listdir(DIR):
full_path = path.join(DIR, file)

Expand Down

0 comments on commit 698eb9b

Please sign in to comment.