Implemented a function to map a player and its neighbours to a player.