from typing import List
import numpy as np
from axelrod.action import Action
from axelrod.interaction_utils import compute_final_score
from axelrod.player import Player
from axelrod.strategies.finite_state_machines import FSMPlayer
IllIlllIlIIlIl, IllIIllIlllllll = Action.C, Action.D
class IIIllIIIlIllI(Player):
    llIllIIlllIIlIIII = "strategy"
    llIIIlIIllIlIlIII = {
        "memory_depth": 3,
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIIIIIIllllllII) -> None:
        super().__init__()
        lIIIIIIllllllII.IlIIIlIlIlIlIIIIl = {
            (IllIlllIlIIlIl, IllIlllIlIIlIl, IllIlllIlIIlIl): 1.0,
            (IllIlllIlIIlIl, IllIlllIlIIlIl, IllIIllIlllllll): 0.5,  
            (IllIlllIlIIlIl, IllIIllIlllllll, IllIlllIlIIlIl): 0.0,  
            (IllIlllIlIIlIl, IllIIllIlllllll, IllIIllIlllllll): 0.25,  
            (IllIIllIlllllll, IllIlllIlIIlIl, IllIlllIlIIlIl): 1.0,  
            (IllIIllIlllllll, IllIlllIlIIlIl, IllIIllIlllllll): 1.0,  
            (IllIIllIlllllll, IllIIllIlllllll, IllIlllIlIIlIl): 1.0,  
            (IllIIllIlllllll, IllIIllIlllllll, IllIIllIlllllll): 0.25,  
        }
    def IIlllIIIlll(lIIIIIIllllllII, lIIIlIllIIIll: Player) -> Action:
        IlIlIIIllIIIlIIlI = [IllIlllIlIIlIl, IllIlllIlIIlIl, IllIlllIlIIlIl]  
        for IlIlIIllIIlIll in range(1, 4):
            if len(lIIIlIllIIIll.history) >= IlIlIIllIIlIll:
                IlIlIIIllIIIlIIlI[-IlIlIIllIIlIll] = lIIIlIllIIIll.history[-IlIlIIllIIlIll]
        return lIIIIIIllllllII._random.random_choice(
            lIIIIIIllllllII.IlIIIlIlIlIlIIIIl[
                (IlIlIIIllIIIlIIlI[-3], IlIlIIIllIIIlIIlI[-2], IlIlIIIllIIIlIIlI[-1])
            ]
        )