From 9f3f2687c08be94da0cbeefd228235f4592c2a9d Mon Sep 17 00:00:00 2001 From: Helen Li Date: Mon, 9 Dec 2019 17:41:25 -0500 Subject: [PATCH] Add files via upload --- randommoveai.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 randommoveai.py diff --git a/randommoveai.py b/randommoveai.py new file mode 100644 index 0000000..d1171a7 --- /dev/null +++ b/randommoveai.py @@ -0,0 +1,9 @@ +import random + +class randomMoveAI: + def __init__(self, color): + self.color = color + + def move(self, state): + chosenmove = random.choice(state.generate_moves(state.board, self.color) + state.movePiece( chosenmove[0], chosenmove[1] )