forked from SharifAIChallenge/AIC21-Client-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAI.py
More file actions
28 lines (23 loc) · 706 Bytes
/
AI.py
File metadata and controls
28 lines (23 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from Model import *
import random
import json
from typing import *
class AI:
def __init__(self):
# Current Game State
self.game: Game = None
# Answer
self.message: str = None
self.direction: int = None
self.value: int = None
"""
Return a tuple with this form:
(message: str, message_value: int, message_dirction: int)
check example
"""
def turn(self) -> (str, int, int):
"""self.message = "hello python"
self.value = random.randint(1,10)
self.direction = random.choice(list(Direction)).value"""
self.direction = Direction.UP.value
return (self.message, self.value, self.direction)