subject

Create a class called WanderBot that inherits from Bot WanderBot is a bot that will wander around randomly. . In the init it should simply call the init from super (and adds no extra instance attributes)
. Note that to do this, the init should take a character input with the same default (8982)
. This value will need to be passed into the super's init
Add two methods to WanderBot Method: wander
This method will choose a random move from the possibilities, making sure that move is valid on the current grid
Procedure
. Initialize a boolean variable has_new_pos as False
. Use a while loop, with the condition not has_new_pos
Set a variable move as the output of calling random. choice on self. moves
Add move to self. position, using add_lists (a function we created earlier), and assign the output to a new variable new_pos
Call check_bounds on new_pos, also passing self. grid_size into check_bounds
Assign the output of check_bounds to has_new_pos
This will lead to exiting the loop when a valid new position has been assigned
Return new_pos
Method: move
No inputs (other than self ) or outputs, just sets self position to be the output of calling self. wander()
Multiple Bots
a) List of bots
Create a list bots_list that contains three distinct WanderBot instances.
Each WanderBot in bots_list will have a different shape, specified with the value passed into the character attribute.
The first WanderBot in bots_list should take the character input value 1078. The second: 1127. The third: 1279.
b) Create grid and play_board
Step 1: Assign two variables
grid_n should be assigned the integer 15
iter_n should be assigned the integer 25
Step 2: Call play_board
Call play_board() with the following inputs for the parameters in play_board:
bots | input should be bots_list
grid_size | input should be grid_n
n_iter | input sould be iter_n
Upon executing the cell, you should see a a 15x15 grid, with three bots (of different shapes), wandering around the grid for 25 iterations.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
You can apply several different worksheet themes from which tab?
Answers: 1
You know the right answer?
Create a class called WanderBot that inherits from Bot WanderBot is a bot that will wander around ra...
Questions
question
Chemistry, 17.11.2020 18:20
question
Mathematics, 17.11.2020 18:20
question
Mathematics, 17.11.2020 18:20
question
Mathematics, 17.11.2020 18:20
Questions on the website: 13722362