Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Answer using python :) Robots' Game You will implement an ASCII game called robots' that has the same rules as the GUI game robots

Please Answer using python :)

image text in transcribedimage text in transcribed

Robots' Game You will implement an ASCII game called robots' that has the same rules as the GUI game robots that came with Unix BSD and is still around in many linux distributions. The game is played on a rectangular field. The player has to escape unharmed a bunch of robots that are programmed to kill the player. The robots move up and down, left and right, and diagonally, always in the direction of the player. The player moves within the rectangle up and down, left and right, and diagonally. The player escapes by manipulating robots to crash into each other. The result is a heap. If a robot walks into the heap, the robot is kaput and adds to the pile of heap. In dire straits, the player can teleport, which places the player at a random location in the rectangle. If that location is a robot or a heap, then the player dies. You can find more details by watching a game on youtube or by reading at wikipedia. Finally, a browser version is at the second link below s//en ia obots (computer Implementation You need to implement the game as an object. Its fields are the width and the height of the rectangle (30 by 60 makes a good field), the player, a list of robots, and a list of heaps. The game is turn-based. The human player gives a movement to her avatar by using one of the following commands ut Movement iUp j Right I Left k down u up and left o up and right n down and left m down and right . does not move tteleport Player, robots, and heaps are represented by two-dimensional coordinates, i.e. by a tuple of two integer values. In order to represent the playing field, you need to generate a list of 30 lists of 60 characters. The lists contain mostly a single white space, but have an "I" where the player is, an "r" where a robot is, and an "*" where a heap is. You print the playing field by printing out 30 strings obtained by joining a list of 60 characters The game starts by randomly generating the position of the player and a given number of robots. The player is guaranteed to not be on top of a robot. The game prints the rectangle with the position to the creen The game then waits for the input from the user and executes the command. A player cannot escape from the rectangle. If a keystroke would take the player out of the rectangle, then the player just stays where it 1S The game then calculates the new position of robots, after determining whether robots have crashed into each other or a heap. The robot movement is simple. If the player is above the robot, the robot moves up, if the player is to the left, the robot moves to the left, etc Robots' Game You will implement an ASCII game called robots' that has the same rules as the GUI game robots that came with Unix BSD and is still around in many linux distributions. The game is played on a rectangular field. The player has to escape unharmed a bunch of robots that are programmed to kill the player. The robots move up and down, left and right, and diagonally, always in the direction of the player. The player moves within the rectangle up and down, left and right, and diagonally. The player escapes by manipulating robots to crash into each other. The result is a heap. If a robot walks into the heap, the robot is kaput and adds to the pile of heap. In dire straits, the player can teleport, which places the player at a random location in the rectangle. If that location is a robot or a heap, then the player dies. You can find more details by watching a game on youtube or by reading at wikipedia. Finally, a browser version is at the second link below s//en ia obots (computer Implementation You need to implement the game as an object. Its fields are the width and the height of the rectangle (30 by 60 makes a good field), the player, a list of robots, and a list of heaps. The game is turn-based. The human player gives a movement to her avatar by using one of the following commands ut Movement iUp j Right I Left k down u up and left o up and right n down and left m down and right . does not move tteleport Player, robots, and heaps are represented by two-dimensional coordinates, i.e. by a tuple of two integer values. In order to represent the playing field, you need to generate a list of 30 lists of 60 characters. The lists contain mostly a single white space, but have an "I" where the player is, an "r" where a robot is, and an "*" where a heap is. You print the playing field by printing out 30 strings obtained by joining a list of 60 characters The game starts by randomly generating the position of the player and a given number of robots. The player is guaranteed to not be on top of a robot. The game prints the rectangle with the position to the creen The game then waits for the input from the user and executes the command. A player cannot escape from the rectangle. If a keystroke would take the player out of the rectangle, then the player just stays where it 1S The game then calculates the new position of robots, after determining whether robots have crashed into each other or a heap. The robot movement is simple. If the player is above the robot, the robot moves up, if the player is to the left, the robot moves to the left, etc

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

The paleolithic age human life, short write up ?

Answered: 1 week ago