From 39ef54d06775ff18587c5a7ef27dd3af12b6b81d Mon Sep 17 00:00:00 2001 From: zeio Date: Sat, 18 Jun 2022 00:04:07 +0300 Subject: [PATCH] Added wm parameter to the CreateMaze function, fixed init file --- pyamaze/__init__.py | 2 +- pyamaze/pyamaze.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyamaze/__init__.py b/pyamaze/__init__.py index 2087153..ad1ba34 100644 --- a/pyamaze/__init__.py +++ b/pyamaze/__init__.py @@ -1 +1 @@ -from pybmaze.pybmaze import maze,agent,COLOR,textLabel +from pyamaze.pyamaze import maze,agent,COLOR,textLabel diff --git a/pyamaze/pyamaze.py b/pyamaze/pyamaze.py index 9a71878..32333f9 100644 --- a/pyamaze/pyamaze.py +++ b/pyamaze/pyamaze.py @@ -344,7 +344,7 @@ def _Open_South(self,x, y): if x+1<=self.rows: self.maze_map[x+1,y]['N']=1 - def CreateMaze(self,x=1,y=1,pattern=None,loopPercent=0,saveMaze=False,loadMaze=None,theme:COLOR=COLOR.dark): + def CreateMaze(self,x=1,y=1,pattern=None,loopPercent=0,saveMaze=False,loadMaze=None,theme:COLOR=COLOR.dark,wm:str='zoomed'): ''' One very important function to create a Random Maze pattern--> It can be 'v' for vertical or 'h' for horizontal @@ -596,7 +596,7 @@ def BFS(cell): c[1]=int(c[1].rstrip(')')) self.maze_map[tuple(c)]={'E':int(i[1]),'W':int(i[2]),'N':int(i[3]),'S':int(i[4])} self.path=BFS((self.rows,self.cols)) - self._drawMaze(self.theme) + self._drawMaze(self.theme,wm) agent(self,*self._goal,shape='square',filled=True,color=COLOR.green) if saveMaze: dt_string = datetime.datetime.now().strftime("%Y-%m-%d--%H-%M-%S") @@ -612,14 +612,14 @@ def BFS(cell): f.seek(f.tell()-2, os.SEEK_SET) f.truncate() - def _drawMaze(self,theme): + def _drawMaze(self,theme,wm:str='zoomed'): ''' Creation of Tkinter window and maze lines ''' self._LabWidth=26 # Space from the top for Labels self._win=Tk() - self._win.state('zoomed') + self._win.state(wm) self._win.title('PYTHON MAZE WORLD by Learning Orbis') scr_width=self._win.winfo_screenwidth()