Answered step by step
Verified Expert Solution
Link Copied!

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.image text in transcribed

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions