original_docstring: 
  		Decides whether the object can be moved or not.
  		If yes, also check whether the object is going to a goal.
  			If it is, set self.ongoal=1
  			If no, set self.ongoal=0
  		Based on keypress, changes coordinates of calling object.
  		Does not update position on GUI. That is done by updatePos.
  		However, clears current position of calling object from the GUI by calling clearCurrPos().
  		
docstring: Decides whether the object can be moved or not.
  If yes, also check whether the object is going to a goal.
  If it is, set self.ongoal=1
  If no, set self.ongoal=0
  Based on keypress, changes coordinates of calling object.
  Does not update position on GUI. That is done by updatePos.
  However, clears current position of calling object from the GUI by calling clearCurrPos().
docstring_tokens: Decides whether the object can be moved or not . If yes also check whether the object is going to a goal . If it is set self . ongoal = 1 If no set self . ongoal = 0 Based on keypress changes coordinates of calling object . Does not update position on GUI . That is done by updatePos . However clears current position of calling object from the GUI by calling clearCurrPos () .
code: def moveTo(self,targetRow,targetCol,currRow,currCol,offset,horizontal):
  		'''
  		Decides whether the object can be moved or not.
  		If yes, also check whether the object is going to a goal.
  			If it is, set self.ongoal=1
  			If no, set self.ongoal=0
  		Based on keypress, changes coordinates of calling object.
  		Does not update position on GUI. That is done by updatePos.
  		However, clears current position of calling object from the GUI by calling clearCurrPos().
  		'''
  
  		currentGrid=gameMap[currRow][currCol]
  		target=gameMap[targetRow][targetCol]
  
  		if(target==-1):
  			#target is a wall
  			#if the object being moved is a boulder, tell man that the boulder can't be moved
  			if(self.__class__.__name__=='boulder'):
  				return 0
  
  		elif(target==-2):
  			#target is a floor tile
  
  			#change gameMap
  			#moving the man who is on goal
  			if(currentGrid==-5):
  				gameMap[currRow][currCol]=-4
  				gameMap[targetRow][targetCol]=-3
  
  			#moving a boulder who is on goal
  			elif(currentGrid<=-10):
  				#decrement number of boulders on goal
  				boulder.bouldersOnGoal-=1
  				gameMap[currRow][currCol]=-4
  				gameMap[targetRow][targetCol]=currentGrid/10*-1-1
  			
  			#moving an object which is on floor
  			else:
  				gameMap[currRow][currCol]=-2
  				gameMap[targetRow][targetCol]=currentGrid
  
  			#update GUI
  			self.clearCurrPos()
  			if(horizontal==1):
  				self.x+=offset
  			else:
  				self.y+=offset
  			self.ongoal=0
  			self.updatePos()
  
  			#if object being moved is a boulder, tell man that the boulder has been moved
  			if(self.__class__.__name__=='boulder'):
  				return 1
  
  		elif(target==-4):
  			#target is a goal state
  
  			#change gameMap
  			#moving the man who is on goal to another goal
  			if(currentGrid==-5):
  				gameMap[currRow][currCol]=-4
  				gameMap[targetRow][targetCol]=currentGrid
  
  			#moving a boulder who is on goal to another goal
  			elif(currentGrid<=-10):
  				gameMap[currRow][currCol]=-4
  				gameMap[targetRow][targetCol]=currentGrid
  			
  			#moving a man which is on floor to a goal
  			elif(currentGrid==-3):
  				gameMap[currRow][currCol]=-2
  				gameMap[targetRow][targetCol]=-5
  
  			#moving a boulder which is on floor to a goal
  			else:
  				#increment number of boulders on goal
  				boulder.bouldersOnGoal+=1
  				gameMap[currRow][currCol]=-2
  				gameMap[targetRow][targetCol]=-1*(currentGrid+1)*10
  
  			#update GUI
  			self.clearCurrPos()
  			if(horizontal==1):
  				self.x+=offset
  			else:
  				self.y+=offset
  			
  			self.ongoal=1
  			self.updatePos()
  
  			#if object being moved is a boulder, tell man that the boulder has been moved
  			if(self.__class__.__name__=='boulder'):
  				return 1
  
  		elif(target>=0 or target<=-10):
  			#target is a boulder
  			#if object being moved is a boulder, tell man that the boulder can't be moved
  			if(self.__class__.__name__=='boulder'):
  				return 0
  
  			#this part reached only if object being moved is the man
  			if(target<=-10):
  				boulderIndex=target/10*-1-1
  			else:
  				boulderIndex=target
  
  			moveTheMan=boulderlist[boulderIndex].handleKeyPress()
  			if(moveTheMan==1):
  				#change gameMap
  				
  				#target boulder is on the floor
  				if(target>=0):
  					#moving man who is on floor to another floor tile
  					if(currentGrid==-3):
  						gameMap[currRow][currCol]=-2
  						gameMap[targetRow][targetCol]=-3
  
  					#moving man who is on goal to a floor tile
  					elif(currentGrid==-5):
  						gameMap[currRow][currCol]=-4
  						gameMap[targetRow][targetCol]=-3
  
  				#target boulder is on a goal
  				else:
  					#moving man who is on floor to a goal
  					if(currentGrid==-3):
  						gameMap[currRow][currCol]=-2
  						gameMap[targetRow][targetCol]=-5
  
  					#moving man who is on goal to a goal
  					elif(currentGrid==-5):
  						gameMap[currRow][currCol]=-4
  						gameMap[targetRow][targetCol]=-5
  
  				#update GUI
  				self.clearCurrPos()
  				if(horizontal==1):
  					self.x+=offset
  				else:
  					self.y+=offset
  				
  				if(target<=-10):
  					self.ongoal=1
  				else:
  					self.ongoal=0
  				self.updatePos()
code_tokens: def moveTo ( self , targetRow , targetCol , currRow , currCol , offset , horizontal ) : currentGrid = gameMap [ currRow ] [ currCol ] target = gameMap [ targetRow ] [ targetCol ] if ( target == - 1 ) : if ( self . __class__ . __name__ == 'boulder' ) : return 0 elif ( target == - 2 ) : if ( currentGrid == - 5 ) : gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = - 3 elif ( currentGrid <= - 10 ) : boulder . bouldersOnGoal -= 1 gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = currentGrid / 10 * - 1 - 1 else : gameMap [ currRow ] [ currCol ] = - 2 gameMap [ targetRow ] [ targetCol ] = currentGrid self . clearCurrPos ( ) if ( horizontal == 1 ) : self . x += offset else : self . y += offset self . ongoal = 0 self . updatePos ( ) if ( self . __class__ . __name__ == 'boulder' ) : return 1 elif ( target == - 4 ) : if ( currentGrid == - 5 ) : gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = currentGrid elif ( currentGrid <= - 10 ) : gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = currentGrid elif ( currentGrid == - 3 ) : gameMap [ currRow ] [ currCol ] = - 2 gameMap [ targetRow ] [ targetCol ] = - 5 else : boulder . bouldersOnGoal += 1 gameMap [ currRow ] [ currCol ] = - 2 gameMap [ targetRow ] [ targetCol ] = - 1 * ( currentGrid + 1 ) * 10 self . clearCurrPos ( ) if ( horizontal == 1 ) : self . x += offset else : self . y += offset self . ongoal = 1 self . updatePos ( ) if ( self . __class__ . __name__ == 'boulder' ) : return 1 elif ( target >= 0 or target <= - 10 ) : if ( self . __class__ . __name__ == 'boulder' ) : return 0 if ( target <= - 10 ) : boulderIndex = target / 10 * - 1 - 1 else : boulderIndex = target moveTheMan = boulderlist [ boulderIndex ] . handleKeyPress ( ) if ( moveTheMan == 1 ) : if ( target >= 0 ) : if ( currentGrid == - 3 ) : gameMap [ currRow ] [ currCol ] = - 2 gameMap [ targetRow ] [ targetCol ] = - 3 elif ( currentGrid == - 5 ) : gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = - 3 else : if ( currentGrid == - 3 ) : gameMap [ currRow ] [ currCol ] = - 2 gameMap [ targetRow ] [ targetCol ] = - 5 elif ( currentGrid == - 5 ) : gameMap [ currRow ] [ currCol ] = - 4 gameMap [ targetRow ] [ targetCol ] = - 5 self . clearCurrPos ( ) if ( horizontal == 1 ) : self . x += offset else : self . y += offset if ( target <= - 10 ) : self . ongoal = 1 else : self . ongoal = 0 self . updatePos ( )
short_docstring: Decides whether the object can be moved or not.
short_docstring_tokens: Decides whether the object can be moved or not .
comment: '''
  		Decides whether the object can be moved or not.
  		If yes, also check whether the object is going to a goal.
  			If it is, set self.ongoal=1
  			If no, set self.ongoal=0
  		Based on keypress, changes coordinates of calling object.
  		Does not update position on GUI. That is done by updatePos.
  		However, clears current position of calling object from the GUI by calling clearCurrPos().
  		'''$SEP$#target is a wall$SEP$#if the object being moved is a boulder, tell man that the boulder can't be moved$SEP$#target is a floor tile$SEP$#change gameMap$SEP$#moving the man who is on goal$SEP$#moving a boulder who is on goal$SEP$#decrement number of boulders on goal$SEP$#moving an object which is on floor$SEP$#update GUI$SEP$#if object being moved is a boulder, tell man that the boulder has been moved$SEP$#target is a goal state$SEP$#change gameMap$SEP$#moving the man who is on goal to another goal$SEP$#moving a boulder who is on goal to another goal$SEP$#moving a man which is on floor to a goal$SEP$#moving a boulder which is on floor to a goal$SEP$#increment number of boulders on goal$SEP$#update GUI$SEP$#if object being moved is a boulder, tell man that the boulder has been moved$SEP$#target is a boulder$SEP$#if object being moved is a boulder, tell man that the boulder can't be moved$SEP$#this part reached only if object being moved is the man$SEP$#change gameMap$SEP$#target boulder is on the floor$SEP$#moving man who is on floor to another floor tile$SEP$#moving man who is on goal to a floor tile$SEP$#target boulder is on a goal$SEP$#moving man who is on floor to a goal$SEP$#moving man who is on goal to a goal$SEP$#update GUI