subject

Create_board(): creates a matrix that has 3 rows with the first two rows having 6 columns (to represent the pockets) and the last row having 2 columns (to represent the Mancala). The first two rows should have the value 4 in each position while the last row should be initiated at 0 for each. This function takes no arguments and returns a matrix of the specified dimensions. Note: The labels A through F should NOT be part of the nested list representing the board. The board should only contain integers representing number of stones.
Call your create_board function to create the board. Pass your board and a list of letters from A to F to the print_game_board() function. You should see output like this:
A B C D E F
4 4 4 4 4 4
0 0
4 4 4 4 4 4
The 0 on the left represents the Mancala stored in the 0 index of the third row of the game board and the 0 on the right represents the Mancala stored in the 1 index of the third row of the game board. This will make the game run smoother since the player that is represented as "0" in the Mancala indexing is also represented as "0" in the row indexing of the pockets. The same goes for the second player, but with the "1" value instead. This function should not return anything.
2. switch_player(): we will allow the players to choose their own names, but for our purposes, it is easier to think of them as number (0 and 1, for indexing purposes). We will display their names to them on the screen, but in the background, we will keep track of them based on their number. This function should take 1 argument, an integer (either 0 or 1) representing the player and should return the opposite integer (1 if 0 is entered and 0 if 1 is entered). This is a simple function, but it will make our code cleaner later. Use your constants!
get_column_choice(): this function will allow us to ask the players which pocket they want to grab stones from. Since we know which row they are grabbing from (since it is not allowed to grab stones from your opponent’s side), we only need to get the column they want. As previously stated, we are using letters to represent the columns to make it easier on the player. This function accepts the current player (should be a 0 or 1), the board, and a list of letters (the same as the list you passed to the print_game_board function) and it will return the index of the column being chosen.
The function should ask the player to enter a column letter, then it should check that the conditions listed below hold. If they don’t meet these conditions, it should ask again until it gets a valid letter, otherwise it should return the corresponding column index for that letter.
Letter entered must be on the game board. It can be lower case or upper case. (Hint: this doesn’t need to be hard coded, don’t make it harder on yourself than it has to be).
There must be stones in the pocket they chose.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:20
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
You know the right answer?
Create_board(): creates a matrix that has 3 rows with the first two rows having 6 columns (to repres...
Questions
question
Mathematics, 03.05.2021 18:30
question
Mathematics, 03.05.2021 18:30
Questions on the website: 13722360