connectfour/controller: Prevent list access by negative indexing.
Currently, if a user does 'move 0', he moves to column 6(last column) in connect_four which is unwanted behaviour and happening due to list getting accessed through negative index (-1). Added a check for that in controller.py file. Fixes #343
This commit is contained in:
		
							parent
							
								
									9c5eaa2f1b
								
							
						
					
					
						commit
						15cc35cb82
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -47,7 +47,7 @@ class ConnectFourBotHandler(GameAdapter):
 | 
			
		|||
        bot_name = 'connect_four'
 | 
			
		||||
        move_help_message = '* To make your move during a game, type\n' \
 | 
			
		||||
                            '```move <column-number>``` or ```<column-number>```'
 | 
			
		||||
        move_regex = '(move (\d)$)|((\d)$)'
 | 
			
		||||
        move_regex = '(move ([1-7])$)|(([1-7])$)'
 | 
			
		||||
        model = ConnectFourModel
 | 
			
		||||
        gameMessageHandler = ConnectFourMessageHandler
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue