1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Misha Larkins [42]
3 years ago
11

Write a function that creates a one-dimensional game board composed of agents of two different types (0 and 1, X and O, stars an

d pluses... whatever you want where the agents are assigned to spots randomly with a 50% chance of being either type. Define the function so that it takes as inputs 1. The number of spots in the game board. Make it so that the default is set to 32. 2. A random seed that you will use to initialize the board (this will make it possible to test the reproducibility of your model). Also set a default seed value. Make sure your function returns your game board (Something to think about: which makes more sense to describe the game board, a list or a Numpy array? What are the tradeoffs?) Show that your function is behaving correctly by printing out the returned game board (Hint: There is more than one way to write this code· If you're having trouble coming up with your own method, you could consider trying to use np.random.choice(), but you'll have to read the documentation to figure out how to get the output you want.)
Computers and Technology
1 answer:
Grace [21]3 years ago
4 0

Answer:

Python code explained below

Explanation:

import random  #importing random library

def initialize_board(noOfSpot=32,seedIn=9):

#function with default spots set as 32

#default seed set as 9

random.seed(seedIn)

gameBoard = [] #initialising gameBoard list with empty values

for i in range(noOfSpot):

gameBoard.append(random.randint(0,1))

#adding values to gameBoard

return gameBoard

 

board =initialize_board(10,2)

print(board)

You might be interested in
In this lab, 172.30.0.0 represents the __________ network and 10.20.1.0 represents the _________ network.
umka21 [38]
172.30.0.0: private network
10.20.1.0: public network
6 0
3 years ago
Ethereum Mining Calculator Profitability and Difficulty Level?
yanalaym [24]

Profitability Calculator: https://www.cryptocompare.com/mining/calculator/eth?HashingPower=200&HashingUnit=MH%2Fs&PowerConsumption=140&CostPerkWh=0.12&MiningPoolFee=1

Difficulty Level Chart: https://www.coinwarz.com/difficulty-charts/ethereum-difficulty-chart

3 0
3 years ago
If one employee is assigned to a project and each project has only one employee working on it, there is a(n) ____ relationship b
Len [333]

Answer:

One-to-one is the answer because there is one project and one employee working on one project.

5 0
3 years ago
Which Application program saves data automatically as it is entered?
Andrei [34K]
The application program that saves data automatically as it is entered is the MS Access.
4 0
3 years ago
You have been given the following String which represents a series of 6 side die rolls:rolls = "1,5,2,3,5,4,4,3,1,1,1,2,3,1,5,6,
Anni [7]

Answer:

see explaination

Explanation:

rolls="1,5,2,3,5,4,4,3,1,1,1,2,3,1,5,6,2"

list1 = list(rolls.split(","))

print("The total # of rolls: {}".format(len(list1)))

j=0

for i in list1:

j+=int(i)

print("Total value of all rolls: {}".format(j))

print("Average roll: {}".format(j/len(list1)))

Please kindly check attachment for program code and output

8 0
3 years ago
Other questions:
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • You want to join your computer to a homegroup but you don't see any homegroups on your home network
    11·1 answer
  • ________________ occur when a system produces incorrect, inconsistent, or duplicate data.
    6·2 answers
  • How do you implement instruction level parallelism
    11·1 answer
  • Is a psychrometer more likely used at a beach or a desert in California
    12·1 answer
  • A program that processes data submitted by the user. Allows a Web server to pass control to a software application, based on use
    11·1 answer
  • Name the tools in plant propagation.<br>Q<br>18.<br>16.<br>17.<br>19.<br>20.<br>please po asap​
    15·1 answer
  • In order for a sort to work, which of the following is required?
    14·1 answer
  • Which of the following expressions in Java is equal to 4?
    11·1 answer
  • What are 3 of the most important things about internet safety that you would recommend and why
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!