Once you figure out how the enemy should behave. You have to define the rules he must play by. A really simple example is the "house rules" for the card game "blackjack": "The dealer must hit until the cards total 17 or more points."