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 11# not all imports are currently used, but they might be in the future and it shows all available functionalities
22import logging
3+ import random
4+ from typing import List
35from socha import (
46 GameState ,
5- Move ,
6- Advance
7+ Move
78)
89from socha .api .networking .game_client import IClientHandler
910from socha .starter import Starter
@@ -15,7 +16,9 @@ class Logic(IClientHandler):
1516 # this method is called every time the server is requesting a new move
1617 # this method should always be implemented otherwise the client will be disqualified
1718 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
1922
2023 # this method is called every time the server has sent a new game state update
2124 # 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