You can use the following code snippet to start working on MiniMax: class MiniMax(?): def choose(self, board): print("\n
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
You can use the following code snippet to start working on MiniMax: class MiniMax(?): def choose(self, board): print("\n
will upvote of down correctly. i will downvote if nonsense is written as rhe answer
You can use the following code snippet to start working on MiniMax: class MiniMax(?): def choose(self, board): print("\n(self.?}, {self.?}: Enter a cell [A-C][1-3]: ") cell-MiniMax.minimax(self, board, True, True) print(cell) board.set(cell, self.sign) def minimax(self, board, self_player, start): #check the base conditions if board.isdone(): #self is a winner if board.get_winner() - ? return 1 #is a tie elif board.get_winner()?: return 0 #self is a looser (opponent is a winner) else: return -1 #make a move (choose a cell) recursively #use the pseudocode given to you above to implement the missing code 722 Goog cut
class Player: def 4 an zel ort n zell se nne se elf. poar tylst 11.b retur retur init (self,name, sign): self.name name self.sign sign def get sign(self): return self.sign der get nane(self): return self.name. ocf choose(self, board): while Trues cell=input("(,0): Enter a cell [A-CI [1-3].format(self.get_name(), self.get_sign())) index (3 int(cell[1])) (ord(cell(01) - 65) - 3 if(index>0 and index 9 and board.isEmpty (index)): board.set(index,self.get_sign()) break print("You did not choose correctly") I