We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e27f50b + 599ca10 commit eb36691Copy full SHA for eb36691
Logger.py
@@ -2,14 +2,13 @@ class Logger:
2
def __init__(self,log_path:str,map_path:str):
3
self.path = log_path
4
with open(map_path, mode="r") as f:
5
- data = "".join(list(map(lambda x: x[2:],f.readlines())))
6
-
7
- with open(self.path, mode="w") as f:
8
- f.write(data);
+ self.map_data = "".join(list(map(lambda x: x[2:],f.readlines())))
9
10
def set_name(self,cool_name:str,hot_name:str):
11
- with open(self.path,mode="a") as f:
12
- f.write(f"{cool_name},{hot_name}")
+ with open(self.path,mode="w") as f:
+ f.write(f"{cool_name},{hot_name}\n")
+ f.write(self.map_data);
+ f.write("0,0");
13
14
def action(self,map_data:str,cool_pos:str,hot_pos:str,cool_item:int,hot_item:int):
15
with open(self.path,mode="a") as f:
@@ -30,4 +29,4 @@ def result(self,player:str,result:str,reason:str):
30
29
else:
31
32
f.write("\ngameend")
33
- f.write(f"\n{result},{reason}")
+ f.write(f"\n,{result},{reason}")
0 commit comments