Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, This is python(3.4) programming problem about Connect Four game. For the problem above, I have a problem with drop_bomb function. Below is my code:
Hi, This is python(3.4) programming problem about "Connect Four" game.
For the problem above, I have a problem with drop_bomb function. Below is my code:
def drop_bomb(board, col_num): col_num = col_num - 1 if col_num or col_num > board._num_cols - 1: return -1 for i in range(board._num_rows): board._slots[i][col_num] = '.' return col_num + 1
For example:
Part VI: drop bomb (board, col num) (4 points This function drops a bomb down the given column of the board, replacing all 'X's and O' s with and returning the value col-num. If col-num is outside the range [1, board.-col-num], the function instead returns -1. In cases whether an invalid bomb drop is attempted, the contents of board must be left unchanged
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started