-
Notifications
You must be signed in to change notification settings - Fork 4
/
generator.py
32 lines (24 loc) · 1.01 KB
/
generator.py
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
pweqpw_template = open("pweqpw.template").read()
pweqpl_template = open("pweqpl.template").read()
pleqpl_template = open("pleqpl.template").read()
tictactoe_template = open("tictactoe.template").read()
comb_template = open("comb.template").read()
content = ""
for item in range(0,3):
tr = pweqpw_template.replace('{{index}}', str(item)).replace('{{indexp1}}', str(item+1))
content = content + tr
for item in range(0,4):
tr = pweqpl_template.replace('{{index}}', str(item)).replace('{{indexp1}}', str(item+1))
content = content + tr
for item in range(0,3):
tr = pleqpl_template.replace('{{index}}', str(item)).replace('{{indexp1}}', str(item+1))
content = content + tr
result = tictactoe_template.replace('{{content}}', content)
comb = ""
for item in range(0,8):
tr = comb_template.replace('{{count}}', str(item)).replace('{{comb}}', str(item))
comb = comb + tr
result = result.replace('{{combs}}', comb)
compiled = open("tictactoe.compiled.code", 'w')
compiled.write(result)
compiled.close()