@@ -111,12 +111,12 @@ def _update_scorecard(self, category, points):
111111
112112 return None
113113
114- def move (self , args , player_id ): # override
114+ def move (self , move , player_id ): # override
115115 """
116116 Handling a player's move.
117117
118118 The type of move is determined and then passed to the corresponding
119- function. The required content of dictionary args depends on the phase
119+ function. The required content of dictionary move depends on the phase
120120 of the game. In the first phase, all players must send their names
121121 before any turns can be performed. From then on, players can roll their
122122 dice, add points to their scorecards, or cross out categories.
@@ -128,24 +128,24 @@ def move(self, args, player_id): # override
128128 'category': name of a category, must be supplied in addition to 'score'
129129
130130 Parameters:
131- args (dict): the current player's move
131+ move (dict): the current player's move
132132 player_id (int): player ID
133133
134134 Returns:
135135 str: error message in case the move was illegal, None otherwise
136136 """
137- if 'roll_dice' in args :
138- return self ._roll_dice (args ['roll_dice' ])
139- if 'score' in args :
140- if 'category' not in args :
137+ if 'roll_dice' in move :
138+ return self ._roll_dice (move ['roll_dice' ])
139+ if 'score' in move :
140+ if 'category' not in move :
141141 return 'a category must be passed'
142- if args ['score' ] == 'add points' :
143- return self ._add_points (args ['category' ])
144- if args ['score' ] == 'cross out' :
145- return self ._cross_out (args ['category' ])
142+ if move ['score' ] == 'add points' :
143+ return self ._add_points (move ['category' ])
144+ if move ['score' ] == 'cross out' :
145+ return self ._cross_out (move ['category' ])
146146 return 'no such score operation'
147- if 'name' in args :
148- return self ._set_name (args ['name' ].strip (), player_id )
147+ if 'name' in move :
148+ return self ._set_name (move ['name' ].strip (), player_id )
149149 return 'no such move'
150150
151151 def _roll_dice (self , dice = None ):
0 commit comments