-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
68 lines (55 loc) · 1.65 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import FileMaker from "./src/FileMaker";
import DrirectoryChecker from "./src/DirectoryChecker";
import Committer from "./src/Committer";
import FileExtension from "./type/FileExtension";
// * FileMaker code
const pythonCode1: string = `
def solution(answers):
answer = []
supo1 = [1, 2, 3, 4, 5]
supo2 = [2, 1, 2, 3, 2, 4, 2, 5]
supo3 = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5]
numOfQ = len(answers)
answer1 = supo1 * (numOfQ // 5) + supo1[0: (numOfQ % 5)]
answer2 = supo2 * (numOfQ // 8) + supo2[0: (numOfQ % 8)]
answer3 = supo3 * (numOfQ // 10) + supo3[0: (numOfQ % 10)]
p = [0, 0, 0]
for i in range( len(answers)):
if answer1[i] - answers[i] == 0 :
p[0] += 1
if answer2[i] - answers[i] == 0 :
p[1] += 1
if answer3[i] - answers[i] == 0 :
p[2] += 1
maxP = max(p)
for idx, val in enumerate(p):
if val == maxP:
answer.append(idx + 1)
return answer
`;
const pythonCode2: string = `
print('my name is jwSong')
`;
const commitCallback = () => {
// * Committer code
Committer.commit("c.py");
// * Commit push code
Committer.push();
};
// FileMaker.createFile("a", "./", "python", pythonCode2);
FileMaker.createFile(
"c",
"/Users/songjiwon/Desktop/custom_cli",
FileExtension.PYTHON,
pythonCode1,
commitCallback
);
// * DirectoryChecker code
/*
const path0 = "/Users/songjiwon/Desktop/custom_cli";
const path1 = "/Users/songjiwon/Desktop";
const path2 = "/Users/songjiwon/Desktop1";
const path3 = "/Users/songjiwon/Desktop ";
const isExisted = DirectoryChecker.isExisted(path3);
console.log(isExisted);
*/