mirror of
https://github.com/maoakeEnterprise/amazing.git
synced 2026-04-28 16:04:35 +02:00
ADD(main): expected output in file test.txt
This commit is contained in:
+3
-1
@@ -8,9 +8,11 @@ def main() -> None:
|
|||||||
config = Parsing.DataMaze.get_data_maze("config.txt")
|
config = Parsing.DataMaze.get_data_maze("config.txt")
|
||||||
print(config)
|
print(config)
|
||||||
amazing = AMazeIng(**config)
|
amazing = AMazeIng(**config)
|
||||||
for gen in amazing.generate():
|
for _ in amazing.generate():
|
||||||
os.system("clear")
|
os.system("clear")
|
||||||
amazing.maze.ascii_print()
|
amazing.maze.ascii_print()
|
||||||
|
with open("test.txt", "w") as output:
|
||||||
|
output.write(amazing.__str__())
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print(err)
|
print(err)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
WIDTH=30
|
WIDTH=30
|
||||||
HEIGHT=30
|
HEIGHT=30
|
||||||
ENTRY=0,0
|
ENTRY=1,1
|
||||||
EXIT=19,14
|
EXIT=29,29
|
||||||
OUTPUT_FILE=maze.txt
|
OUTPUT_FILE=maze.txt
|
||||||
PERFECT=True
|
PERFECT=True
|
||||||
GENERATOR=Kruskal
|
GENERATOR=Kruskal
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ class AStar(MazeSolver):
|
|||||||
path = [(self.start, self.best_path(maze, self.start, None))]
|
path = [(self.start, self.best_path(maze, self.start, None))]
|
||||||
visited = [self.start]
|
visited = [self.start]
|
||||||
while len(path) > 0 and path[-1][0] != self.end:
|
while len(path) > 0 and path[-1][0] != self.end:
|
||||||
print(path[-1])
|
|
||||||
if len(path[-1][1]) == 0:
|
if len(path[-1][1]) == 0:
|
||||||
path.pop(-1)
|
path.pop(-1)
|
||||||
if len(path) == 0:
|
if len(path) == 0:
|
||||||
@@ -153,7 +152,6 @@ class AStar(MazeSolver):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def solve(self, maze: Maze) -> str:
|
def solve(self, maze: Maze) -> str:
|
||||||
print(maze)
|
|
||||||
res = self.get_path(maze.get_maze())
|
res = self.get_path(maze.get_maze())
|
||||||
if res is None:
|
if res is None:
|
||||||
raise Exception("Path not found")
|
raise Exception("Path not found")
|
||||||
|
|||||||
@@ -1,23 +1,34 @@
|
|||||||
7D53BFD3D57951517D1D
|
957D3955553B957917B93D3D15553B
|
||||||
3D12C3903BD03AD4178D
|
AB97AABBD16847D6ABAAAD452B97C6
|
||||||
2BAEBEEEAA92EED547C9
|
8687A8443EBC55538286E953A807D3
|
||||||
2287ED17AAAC5393FFF0
|
878506952BAD3B942EAD503E86ED52
|
||||||
6C6951292A87D2AEBD30
|
852D4383C6C384438147D2C3879796
|
||||||
37D43E8686E93AABAB8C
|
ED2B96EC7D384792EC5792BEC38103
|
||||||
21516D2D47FEE8284049
|
BBC2C795516C13EC51556C053AAEAA
|
||||||
6C7857C3FB9116C696D8
|
8452BD43D4396AD552D3BBEBE803EE
|
||||||
751453D6D2AAC57BE970
|
853A8552B902BABD5290029696AA93
|
||||||
3BA952D17EA83BD05470
|
C7AC2B9686EE82ABB82EEC07C7E86A
|
||||||
22AAD2907BAE86967B74
|
D3AD0683C7D3EAC2C6C3D5693956D2
|
||||||
2AA83C2EFC69696FBC35
|
9687E92EBBD0103857D43916A85796
|
||||||
686EE96FD7D4783FAD21
|
C52BD2A942D2EAE857D542E946D147
|
||||||
7ED17ED3D57D3EC52FA0
|
D3EC12EE9692F852FFFBBE96957EBB
|
||||||
7B943D16FB7BABD3AFC8
|
B87BAA97852AFED057FC07C507D506
|
||||||
7407C5297EB82EB84174
|
C2942C47C7EEFFFAFFFD4517ED53C3
|
||||||
392D53C6912EE9447E9D
|
946BABB91553BBFEFD51796955147A
|
||||||
62A952BBAAC13EFD7B89
|
C3BA82AAC53C6AFBFFF816BEBD053A
|
||||||
3AAC3EC6EABAAD557824
|
D06AE828792B90543D568547856D42
|
||||||
66C7C7D7D6C6C7D556CD
|
92BC56AAD2C6A87B83916D516BD53A
|
||||||
|
AAAD13C47AD3AED46EEA95103853C2
|
||||||
|
EAAD2815143C43D3BBD0696EAED416
|
||||||
|
B847EEC3EBC57AD4407C7C3B85792B
|
||||||
|
AEBBD5503A9156BD16D1792A8796AA
|
||||||
|
87AC3BD2C42C57C383D2BEAC47C3EA
|
||||||
|
C50542B857879112E812C1297BD6BA
|
||||||
|
D3C3D44417C7EEAC3EAC52C47C516A
|
||||||
|
BA903B91693B97AB87A938157D5052
|
||||||
|
802A82EC5684414287AAEE87953AD2
|
||||||
|
EEEEEC57D547D6D6C546D54547C47E
|
||||||
|
|
||||||
1,1
|
1,1
|
||||||
16,15
|
29,29
|
||||||
|
SSSSEESSESSSENEEESWSSWSSWSSSSESESSENNNNESEESWSSSWWWSESSSSESWSEENESEEEENNNESESSSEENNNNESEESESSEENEESENNEESW
|
||||||
|
|||||||
Reference in New Issue
Block a user