Project 7 Specs & Solution

Project 7 Specs & Solution - Programming Assignment...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment 7 Attack of the Robots Time due: 9:00 PM Thursday, December 1 The Mechanoids of Planet Zork have captured you! To satisfy their lust for oilshed and bloodshed, they have thrown you in an arena with killer robots. Well, that's the scenario for a new video game under development. Your assignment is to complete the prototype that uses character-based graphics. Each robot is equipped with a radio receiver tuned to one of three channels. If the robot receives a command transmitted on the channel its receiver is tuned to, it will obey that command. There is a transmitter that lets one choose a channel and broadcast a command to all robots listening on that channel. The player managed to steal the transmitter, but it was damaged in the fight; half the time, an attempt to transmit a command won't work. If you execute this Windows program or this Mac program , you will see the player (indicated by @) in a rectangular arena filled with killer robots (each indicated by a digit character, the number of the channel the robot's receiver is tuned to). At each turn, you'll select an action for the player to take: move one step or stay put. The player will take the action. You will then tell the player a command to transmit on one particular channel. Then each robot will move. Normally, each robot will move one step in a random direction. However, if the transmitter works this turn (half the time it won't), those robots listening on the channel selected will move one step in the direction commanded. If a robot moves onto the grid point occupied by the player, the player dies. (If the player moves to a grid point occupied by a robot, the player dies, so that would be a dumb move.) The grid points may have wall segments. If the player or a robot moving of its own free will chooses a direction such that moving would be to a grid point occupied by a wall or to a point off the grid, then the player or robot just doesn't move that turn. If a robot moving under the command of the player attempts to move into a wall or off the grid, it doesn't move that turn, but suffers 1 unit of damage. A robot that has suffered 3 units of damage is dead and is removed from the game. Clearly, it's in the player's interest to command robots to smash into walls or the edges of the grid. This smaller Windows version or Mac version of the game may help you see the operation of the game more clearly. At each turn the player may take one of these actions:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1. Stand. In this case, the player does not move. 2. Move one step north, east, south, or west. If the player attempts to move onto a wall or out of the arena (e.g., south, when on the bottom row), the result is the same as standing. If player moves to a grid point currently occupied by a robot, the player dies. The game allows the user to select the player's action: n/e/s/w for movement, or x for
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/06/2012 for the course CS 31 taught by Professor Melkanoff during the Fall '00 term at UCLA.

Page1 / 22

Project 7 Specs & Solution - Programming Assignment...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online