本文整理匯總了Python中Stack.myStack方法的典型用法代碼示例。如果您正苦於以下問題:Python Stack.myStack方法的具體用法?Python Stack.myStack怎麽用?Python Stack.myStack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stack
的用法示例。
在下文中一共展示了Stack.myStack方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import Stack [as 別名]
# 或者: from Stack import myStack [as 別名]
def __init__(self,size):
## initializes all the stacks and variables used to store info, and initializes stack object
self.Stack = []
self.Explore1Stack = []
self.Explore2Stack = []
self.SolutionStack = []
self.linelist = []
self.myStack = Stack.myStack()
self.size = size
## self.map stores the information for all the cells, each cell has four [0,0,0,0]'s
## the first grouping of 0's stores info about the solution, the second grouping stores info about the solution
## the third grouping stores info about the borders of the maze, and the fourth grouping stores info about the walls
## the four 0's in each one correspond the the West,South,East and North directions
self.map = [[[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] for i in range(self.size + 2)] for i in range(self.size + 2)]
self.win = GraphWin("My Maze",self.size*40+1,self.size*40+1)
## randomly chooses location for the entrance, exit and key
self.entrance,self.exit,self.key = self.generatePoints()