Reference no: EM132177999
The game requires two players where the first one has black disks while the second one has white disks. The first player starts by placing a black disk on any empty cell on the board, then the second player places a white disk on an empty cell, and so on. The game ends once one of the players wins the game or there are no empty cells on the board (No winner).
A player wins the game if there is a complete row, col, or diagonal that is full of the player's disks list a python function that consumes brd which is a (dictof Str (listof (anyof 'B' 'W' 'E'))) represents a board of size NxN (N>=2), B for Black, W for White,E for empty and color which is a string (any of 'W' and 'B') returns true if brd is a winner board for color, false otherwise.
for example
bda = { 'r1' : ['B','W','W'],
'r2' : ['E','B','W'],
'r3' : ['E','E','B'],
'c1' : ['B','E','E'],
'c2' : ['W','B','E'],
'c3' : ['W','W','B'],
'd1' : ['B','B','B'],
'd2' : ['W','B','E']}
function(bda, "B") => True
function(bda,"W") => False