How do I assign the resulting numbers from row and column in this function: def PlacePlayer(board,player): ...

80.2K

Verified Solution

Question

Programming

How do I assign the resulting numbers from row and column inthis function:

def PlacePlayer(board,player):  row = DieRoller(1,6)  col = DieRoller(1,6)  board[row][col] = 'player'  return board,player

To the player['row'] and player['col'] in this function in placeof the 0s:

def GenPlayer(level): player = {} player['name'] = GenName() player['history'] = GenHistory() #history player['attack'] = DieRoller(3,6) + DieRoller(level,4) player['defense'] = DieRoller(3,6) + DieRoller(level,4) player['health'] = DieRoller(5,6) + DieRoller(level,4) player['row'] = 0 player['col'] = 0

Answer & Explanation Solved by verified expert
3.7 Ratings (329 Votes)
In the below function you are returning 2 values One is board and the second is player def PlacePlayerboardplayer row DieRoller16 col DieRoller16 boardrowcol    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students