Skip to content

Instantly share code, notes, and snippets.

@mjansen401
Created April 4, 2011 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjansen401/901565 to your computer and use it in GitHub Desktop.
Save mjansen401/901565 to your computer and use it in GitHub Desktop.
AI factory
class AIFactory
def create_ai(ai_type)
if ai_type == :unbeatable
ai = Minimax.new
elsif ai_type == :easy
ai = Random.new
end
ai
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment