Spaces:
Configuration error
Configuration error
Upload stratego/strategies/random_move.py with huggingface_hub
Browse files
stratego/strategies/random_move.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
from typing import List
|
| 3 |
+
from .base import Strategy
|
| 4 |
+
|
| 5 |
+
class RandomStrategy(Strategy):
|
| 6 |
+
def get_context(self) -> str:
|
| 7 |
+
return "Play randomly: mix offensive and defensive moves."
|
| 8 |
+
|
| 9 |
+
def choose(self, legal_moves, observation):
|
| 10 |
+
return random.choice(legal_moves)
|