generated from mwc/lab_tic_tac_toe
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			314 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			314 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from random import choice
 | 
						|
 | 
						|
class RandomStrategy:
 | 
						|
    """A Strategy which randomly chooses a move. Not a great choice.
 | 
						|
    """
 | 
						|
    def __init__(self, game):
 | 
						|
        self.game = game
 | 
						|
 | 
						|
    def choose_action(self, state):
 | 
						|
        possible_actions = self.game.get_actions(state)
 | 
						|
        return choice(possible_actions)
 |