From 5e65ae1c00926f8f3a9456ef25f19283e5e6bc18 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 26 Mar 2019 11:17:09 +0100 Subject: [PATCH] Adds stuff --- .gitignore | 1 + pytron | 2 +- pytron_run/ai_manager/dummy/ai.py | 11 +++++++++++ pytron_run/ai_manager/dummy2/ai.py | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pytron_run/ai_manager/dummy/ai.py create mode 100644 pytron_run/ai_manager/dummy2/ai.py diff --git a/.gitignore b/.gitignore index fd4f27f..ce153cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ assets/ node_modules package.lock +*.pyc diff --git a/pytron b/pytron index 0bfec9f..0ff6f76 160000 --- a/pytron +++ b/pytron @@ -1 +1 @@ -Subproject commit 0bfec9f0e77905a6ad785bd238e2db509ca9cac9 +Subproject commit 0ff6f7632dd96fbf0d8c089d821b0124f6267906 diff --git a/pytron_run/ai_manager/dummy/ai.py b/pytron_run/ai_manager/dummy/ai.py new file mode 100644 index 0000000..c6eacd5 --- /dev/null +++ b/pytron_run/ai_manager/dummy/ai.py @@ -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 diff --git a/pytron_run/ai_manager/dummy2/ai.py b/pytron_run/ai_manager/dummy2/ai.py new file mode 100644 index 0000000..e15e769 --- /dev/null +++ b/pytron_run/ai_manager/dummy2/ai.py @@ -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