File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
# not all imports are currently used, but they might be in the future and it shows all available functionalities
2
2
import logging
3
+ import random
4
+ from typing import List
3
5
from socha import (
4
6
GameState ,
5
- Move ,
6
- Advance
7
+ Move
7
8
)
8
9
from socha .api .networking .game_client import IClientHandler
9
10
from socha .starter import Starter
@@ -15,7 +16,9 @@ class Logic(IClientHandler):
15
16
# this method is called every time the server is requesting a new move
16
17
# this method should always be implemented otherwise the client will be disqualified
17
18
def calculate_move (self ) -> Move :
18
- return Move (action = Advance (distance = 1 , cards = []))
19
+ moves : List [Move ] = self .game_state .possible_moves ()
20
+ move : Move = random .choice (moves )
21
+ return move
19
22
20
23
# this method is called every time the server has sent a new game state update
21
24
# this method should be implemented to keep the game state up to date
You can’t perform that action at this time.
0 commit comments