Question: Python 3.6 Requriements Print all real numbers to 2 decimal points unless stated otherwise Restrictions No global variables may be used Your main function may
Python 3.6RequriementsPrint all real numbers to 2 decimal points unless stated otherwiseRestrictionsNo global variables may be usedYour main function may only declare variables and call other functionsDescriptionWrite a program to implement the game connect-n. Connect-n is like Connect-4 but the size of the board the number of pieces in a row needed to win are user parameters. If you have never played Connect-4 before you can play it here: https://www.mathsisfun.com/games/connect4.html. The basic gist of the game is that each player takes a turn dropping one of their pieces into a column. Pieces land on top of pieces already played in that column. Each player is trying to get n pieces in a row either veritcally, horizontally or diagonally. The game ends if either player gets n pieces in a row or the board becomes full.Additional Details:The first 3 inputs specify thte game to be played. They will be entered in the following orderThe number of rows on the boardThe number of columns on the boardThe number of pieces in a row needed to wiIt is ok if the number of pieces in a row is larger than what can fit on a boardFor example on a 3 X 3 board it is ok for the number of pieces in a row needed to win to be 100Player 1's pieces are represented by XPlayer 2's pieces are represented by OCapital Oh, not zeroPlayer 1 always plays firstIf the user enters an invalid input your program should continue to ask them for input until valid input is enteredAfter the game is over a winner should be declared if there is one and if there is no winner a tie should be declaredAssumptionsInput will not always be validIf invalid input is entered your program should continue to ask for input until valid input is enteredValid InputNumber of rowsAn integer greater than 0Number of columnsAn integer greater than 0Number of pieces in a row needed to winAn integer greater than 0User MoveAn integer specifying a column between 0 and the number of columns - 1 that is not already fullHintsYou will want to break your problem down into logical steps before begninning on it.Each of these steps will become a functionEach of these steps might have steps within them so you should create functions here as well to help break down the problem even fartherOnce you get to small enough step go ahead and solve itYou can draw a lot of inspiration from tic tac toeHere are some of the functionsget_game_attributesmake_empty_board, display_boardplay_connectn, get_move, is_valid_movegame_over, game_won, row_win, col_win, diag_win, right_diag_win, left_diag_winExamplesExample 1Enter the number of rows: 3Enter the number of columns: 4Enter the number of pieces in a row to win: 30 1 2 32 * * * *1 * * * *0 * * * *Enter the column you want to play in: 10 1 2 32 * * * *1 * * * *0 * X * *Enter the column you want to play in: 20 1 2 32 * * * *1 * * * *0 * X O *Enter the column you want to play in: 20 1 2 32 * * * *1 * * X *0 * X O *Enter the column you want to play in: 00 1 2 32 * * * *1 * * X *0 O X O *Enter the column you want to play in: 20 1 2 32 * * X *1 * * X *0 O X O *Enter the column you want to play in: 30 1 2 32 * * X *1 * * X *0 O X O OEnter the column you want to play in: 30 1 2 32 * * X *1 * * X X0 O X O OEnter the column you want to play in: 10 1 2 32 * * X *1 * O X X0 O X O OEnter the column you want to play in: 30 1 2 32 * * X X1 * O X X0 O X O OPlayer 1 won!Example 2Enter the number of rows: bobEnter the number of rows: -4Enter the number of rows: 1Enter the number of columns: jackEnter the number of columns: -3Enter the number of columns: 2Enter the number of pieces in a row to win: -4Enter the number of pieces in a row to win: momEnter the number of pieces in a row to win: 1000 10 * *Enter the column you want to play in: monkeyEnter the column you want to play in: 10Enter the column you want to play in: 2Enter the column you want to play in: -3Enter the column you want to play in: 00 10 X *Enter the column you want to play in: mathEnter the column you want to play in: 3.2Enter the column you want to play in: 1.2Enter the column you want to play in: 10 10 X OTie Game
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
