This commit is contained in:
2019-03-19 16:44:34 +01:00
parent 881bece87b
commit fcf466275a
7 changed files with 111 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*/ai.py")
__all__ = ['.'.join(f.split('.')[:-1]) for f in modules if isfile(f)]
+11
View File
@@ -0,0 +1,11 @@
"""An AI to try things"""
from tron.player import Player, Direction
class Ai(Player):
"""" A basic AI"""
def __init__(self):
super(Ai, self).__init__()
def action(self, game):
return Direction.RIGHT
+8
View File
@@ -0,0 +1,8 @@
from tron.player import Player, Direction
class Ai(Player):
def __init__(self):
super(Ai, self).__init__()
def action(self, game):
return Direction.LEFT