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
Which of the following is generally true about Open Source Software?
JulijaS [17]
<span>Open source software is usually free to download and install, and it can be studied, changed, and distributed according to the rights of the software. I don't believe there is any copyright laws on this type of software. The most known open source software is Linux and it's available for most operating systems right now. Typically, open source owners just ask for donations for their work.</span>
3 0
4 years ago
Maya wrote a program and forgot to put the steps in the correct order. Which step does Maya need to review? Pattern following Pl
Drupady [299]

Answer:

Sequencing

Explanation:

7 0
3 years ago
Read 2 more answers
A computer hacker trying different combinations of characters to crack a password is a ________.
Natalka [10]

Answer:

Brute force attack

Explanation:

it happens when hackers try different combos of characters to guess a password in a short amount of time

5 0
2 years ago
Read 2 more answers
Nurse Jackie is a humorous depiction of a drug-addicted nurse who struggles to balance the demands of her hectic hospital job wi
11Alexandr11 [23.1K]

Answer:

dramedy would make since to me

Explanation:

3 0
3 years ago
If a company becomes a technology company ,what does this mean to employees
MA_775_DIABLO [31]
A place to work. Of course
5 0
3 years ago
Other questions:
  • If you are trying to create a web page for your band and having difficulty creating links to other groups on your page, what is
    7·1 answer
  • You want to plug a keyboard into the back of a computer. you know that you need to plug the keyboard cable into a ps/2 port. whi
    9·1 answer
  • What Intel socket recommends the use of a liquid cooling system?
    12·1 answer
  • Below is an image from Google Trends that plots Cats and Dogs. It shows a line that is higher for dogs than cats. Choose the mos
    11·1 answer
  • What are 3 important reasons to reconcile bank and credit card accounts at set dates?
    15·1 answer
  • How do mentors provide professional development opportunities?
    8·2 answers
  • What is a navigation bar?
    7·1 answer
  • 30 points
    7·1 answer
  • When should you stop where you are, drop to the
    11·1 answer
  • Accenture is one of several hundred companies that has signed on to the united nations global compact (ungc) business ambition p
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!