Files
code/src/composables/helper.ts
2024-10-04 17:25:29 +08:00

68 lines
695 B
TypeScript

import { ref } from "vue"
export const insertText = ref("")
export const cSymbols = [
";",
",",
"&",
"{}",
"=",
"==",
">",
"<",
" != ",
" || ",
" && ",
"()",
'printf("");',
'scanf("");',
"int ",
"float ",
"%d",
"%.2f",
"if () {}",
"else {}",
"a",
"b",
"c",
"\n",
]
export const pythonSymbols = [
":",
'""',
",",
"+",
"-",
"*",
"/",
"//",
"%",
"()",
"=",
"==",
">",
"<",
" != ",
"print()",
"input()",
"if ",
"else:",
"for ",
" in ",
"range():",
"while ",
"[]",
'"%.2f" % ',
"a",
"b",
"c",
"\n",
]
export function getText(c: string) {
if (c === "\n") return "回车"
else return c
}