Write a program that create a

Assignment Help C/C++ Programming
Reference no: EM13852853

Design and implement a C++ program for the given specification.

Write a program that allows a user (player) to navigate a robot through a maze from the start position at the bottom left of the maze, to the centre of the maze.

The maze is constructed on a grid of 17 x 17 small squares. The maze given for this assignment is shown below, with row and column numbers. The robot starts in the bottom left corner (row 15, column 1). The robot must move vertically and horizontally along the black squares, until it reaches the square in the middle of the maze (row 8, column 8).

The row and column number system has been chosen to suit the drawing of the maze on the screen, from a two-dimensional array in the program.

The maze can be drawn from a console program using graphics characters, as shown above. A white square is ASCII character code 219, and a black square is a space character. The robot position is shown by R. The end position is shown by E. (On the computer screen, the "squares" appear as rectangles because the screen characters each occupy a rectangular shape.) If your own computer cannot display the graphics character (because you are using a different language from English, or using the Macintosh) then use the * character instead of the graphics character for a "white square".

The player can enter the commands U, R, D or L to move the robot up, right, down, or left to an adjacent black square. Also, the user can enter Q to quit the program. The program must ensure the robot stays in the black squares. If a player command would cause the robot to go to a white square, the robot must not move. Diagonal moves are not possible.

After each input, the program should display the maze image again, showing the new robot position graphically and as row and column coordinates (see the screen image above).

NOTE: The maze in the image on page 1 was used in a Micromouse competition where a robot is required to move to the middle of the maze, even though it does not know the maze layout. The robot has sensors that detect the presence of walls. The maze is designed so a robot cannot get to the middle by always staying next to either the left wall or the right wall as it moves through the maze.

For this assignment, the Micromouse maze has been modified so it requires at least one of each command (U, R, D, L) for the player to get the middle of the maze. Due to the limitations of using block graphics, the maze obstacles are solid blocks instead of walls. Also, the centre of the maze is a single square as this improves the suitability of the maze as a test for your program.

The maze layout is stored in the two-dimensional maze array given below. The row and column numbers given in the diagram on page 2 and on the screen image above are the same as the row and column numbers in the array. C++ code for the array definition is available with the assignment on AUTonline, in file Maze.cpp. Copy and paste this into your file.

Each number in the array represents the contents of the corresponding square in the maze.

- 1 means the square is blocked. This will show as a white square in the maze image.

- 0 means the square is not blocked so the robot can move to this square. This square will be black in the maze image.

The robot starts at row 15, column 1 and the user must move the robot to the square at the centre of the maze (row 8, column 8).

Attachment:- Assignment.rar

Reference no: EM13852853

Questions Cloud

How many liters of water should you add : If you have 60% alcohol and wish to dilute with water to make 12 liters 40% alcohol, How many liters of water should you add?
Why inflation is a concern to investor : What are the differences between top-down and bottom-up approaches in asset allocation. Why inflation is a concern to investor when investing in a country
Complete the accounting cycle including recording process : Complete the accounting cycle including the recording process from source documents to the post-closing trial balance for a service business. Interpret and apply generally accepted accounting principles (GAAP) to analyze, record, and report financ..
List four methods for obtaining customer feedback : List four methods for obtaining customer feedback. Name three ways you can maintain good relations with existing customers. What is the benefit of using an even number of response options in a survey question?
Write a program that create a : Write a program that allows a user to navigate a robot through a maze from the start position at the bottom left of the maze, to the centre of the maze.
Analyze the implications of the state decision : Identify a state that has not elected to participate in the Medicaid expansion initiative under the Affordable Care Act. Critically analyze the implications of the state's decision to opt out of Medicaid expansion on the citizens of the state
Characteristics of the socio-economic environment : 1. What are the characteristics of the socio-economic environment in many western European countries that reduced the negative human impact of the most recent global economic meltdown (2008)?
Draw a time line of the cash flows : Draw a time line of the cash flows. For this section of the project, students should follow and use the Cash Flow Estimation Excel Template File provided under the "Example Files for Term Project" folder.
Identify contemporary management challenges : Identify contemporary management challenges facing health care organizations. Assess the implications of various health care management challenges and methods of managing them

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program in c that will find smallest value

Write a programe c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

  Implement a program for this machine

Implement a program for this machine - design a special ATM machine to be used by needy people.

  Write a c++ program that prompts the user for a double

Write a C++ program that prompts the user for a double that is either positive or negative.

  A stack is referred to as a last-in first-out

This lab, along with your TA, will help you navigate through designing, implementing, and testing a dynamic stack. Recall, a stack data structure is a restricted linked list, where only the top node in the stack may be accessed at any given time

  Computes a students grade for an assignment

Write a C++ program that computes a student's grade for an assignment as a percentage given the student's score and total points.

  Class named realestate that has data members

Create a class named RealEstate that has data members to hold the price of a house, the number of bedrooms, and the number of baths. Member functions include overloaded insertion and extraction operations

  Reads in a list of integers

Write a program in C++ that reads in a list of integers into and array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should reque..

  Program that asks user to enter text and show given output

Write a program that asks the user to enter some text and then displays that text with all e's and E's replaced with 3's and all s's and S's replaced by 5's.

  1 prepare a program to read 3 numbers x y z use conditional

1. prepare a program to read 3 numbers x y z. use conditional statement and evaluate values of variables a b and c.

  Implement function types that takes no input

Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double.

  The value of minimal positive vector element

I need function which will evaluate. The value of minimal positive vector element - if none exists, return -1;

  Prints the row sums and the column sums

Write a program that reads a 5 x 5 array of integers and then prints the row sums and the column sums

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd