You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
438 B
18 lines
438 B
3 years ago
|
import os
|
||
|
|
||
|
|
||
|
preH = open("pre.h", "r").read()
|
||
|
preCpp = open("pre.cpp", "r").read()
|
||
|
|
||
|
for dayNum in range(1, 26):
|
||
|
pad = f'{dayNum:02}'
|
||
|
dirName = f"src/days/{pad}"
|
||
|
try:
|
||
|
os.mkdir(dirName)
|
||
|
except OSError:
|
||
|
continue
|
||
|
with open(f"{dirName}/Day{pad}.h", "w") as file:
|
||
|
file.write(preH.replace("XX", pad))
|
||
|
with open(f"{dirName}/Day{pad}.cpp", "w") as file:
|
||
|
file.write(preCpp.replace("XX", pad))
|